internal void Heartbeat(string path, ILogger logger)
        {
            logger.Log(
                isUserOnlyLog: false,
                LogLevel.Trace,
                string.Format(PowerShellWorkerStrings.UpdatingManagedDependencySnapshotHeartbeat, path));

            if (_storage.SnapshotExists(path))
            {
                try
                {
                    _storage.SetSnapshotAccessTimeToUtcNow(path);
                }
                // The files in the snapshot may be read-only in some scenarios, so updating
                // the timestamp may fail. However, the snapshot can still be used, and
                // we should not prevent function executions because of that.
                // So, just log and move on.
                catch (IOException e)
                {
                    LogHeartbeatUpdateFailure(logger, path, e);
                }
                catch (UnauthorizedAccessException e)
                {
                    LogHeartbeatUpdateFailure(logger, path, e);
                }
            }
        }
Example #2
0
        internal void Heartbeat(string path, ILogger logger)
        {
            logger.Log(
                isUserOnlyLog: false,
                LogLevel.Trace,
                string.Format(PowerShellWorkerStrings.UpdatingManagedDependencySnapshotHeartbeat, path));

            if (_storage.SnapshotExists(path))
            {
                _storage.SetSnapshotAccessTimeToUtcNow(path);
            }
        }