public void RunIdleOperations() { bool tryEnter = Monitor.TryEnter(idleLocker); try { if (tryEnter == false) { return; } TransportState.OnIdle(); IndexStorage.RunIdleOperations(); Tasks.ClearCompletedPendingTasks(); } finally { if (tryEnter) { Monitor.Exit(idleLocker); } } }
public void RunIdleOperations() { bool tryEnter = Monitor.TryEnter(idleLocker); try { if (tryEnter == false) { return; } WorkContext.LastIdleTime = SystemTime.UtcNow; TransportState.OnIdle(); IndexStorage.RunIdleOperations(); IndexReplacer.ReplaceIndexes(IndexDefinitionStorage.Indexes); Tasks.ClearCompletedPendingTasks(); } finally { if (tryEnter) { Monitor.Exit(idleLocker); } } }