private async Task RestartWatcherLogic(ILocalCallWatcher watcher) { bool result = false; while (!result) { await Task.Delay(15000); result = watcher.StartWatching(); } }
private void PushToRestart(ILocalCallWatcher watcher) { var task = RestartWatcherLogic(watcher); restartWorkerList.Add(task); task.ContinueWith(t => { if (t.IsCompleted) { logger.LogWarning($@"Watcher for dir {watcher.WatchingDir} restart ok"); restartWorkerList.Remove(task); } }); }
public ServiceFacade(IBoxLocations boxLocations, IOSHelper oshelper, ILogger <ServiceFacade> logger, ILocalCallWatcher inbox, ILocalCallWatcher rcbox, IOrchExecutor orchExecutor) { this.boxLocations = boxLocations; this.oshelper = oshelper; this._logger = logger; this.InBoxFileWatcher = inbox ?? throw new ArgumentNullException("inbox"); this.RebootWatcher = rcbox ?? throw new ArgumentNullException("rcbox"); this.OrchExecutor = orchExecutor ?? throw new ArgumentNullException("orchExecutor"); }