private static void CancelOldWorks(WorkManager workManager, string[] oldWorkNames, ILoggerService loggerService) { loggerService.StartMethod(); foreach (var oldWorkName in oldWorkNames) { workManager.CancelUniqueWork(oldWorkName); loggerService.Info($"Worker {oldWorkName} is canceled."); } loggerService.EndMethod(); }