public static async Task DeleteAllUnusedDataOnDisk(IFileSystemOperations fileSystemOperations,
                                                           IMessagingService messagingService, ILoggerService loggerService)
        {
            var dateTimeNow = DateTime.Now;
            var timeElapsed = new TimeSpan((dateTimeNow - Properties.Settings.Default.ConvertingDataFolderCheck).Ticks);

            if (timeElapsed.TotalHours > ProjectSettings.IntervalHoursToDeleteUnusedPackages)
            {
                messagingService.ShowMessage("Очистка пространства на жестком диске...");
                loggerService.DebugLog("Очистка пространства на жестком диске...");

                KillPreviousRunProcesses();
                var result = await Task.Run(
                    () => fileSystemOperations.DeleteAllDataInDirectory(ProjectSettings.ConvertingDirectory, DateTime.Now,
                                                                        ProjectSettings.IntervalHoursToDeleteUnusedPackages));

                if (result.HasErrors)
                {
                    messagingService.ShowAndLogErrors(result.Errors);
                }

                Properties.Settings.Default.ConvertingDataFolderCheck = new TimeSpan(dateTimeNow.Ticks);
                Properties.Settings.Default.Save();
            }
        }
        public static async Task SignaturesOnDataBase(IProjectSettings projectSettings, IMessagingService messagingService,
                                                      ILoggerService loggerService)
        {
            var dateTimeNow = DateTime.Now;
            var timeElapsed = new TimeSpan((dateTimeNow - Properties.Settings.Default.SignaturesCheck).Ticks);

            if (timeElapsed.TotalHours > ProjectSettings.IntervalSignatureUpdate)
            {
                messagingService.ShowMessage("Перезагрузка ресурсов...");
                loggerService.DebugLog("Перезагрузка ресурсов...");

                await projectSettings.ConvertingResources.ReloadResources();

                Properties.Settings.Default.SignaturesCheck = new TimeSpan(dateTimeNow.Ticks);
                Properties.Settings.Default.Save();
            }
        }
        public static async Task CheckAndDeleteUnusedPackagesOnDataBase(ConvertingServerServiceFactory convertingServerServiceFactory,
                                                                        IMessagingService messagingService, ILoggerService loggerService)
        {
            var dateTimeNow = DateTime.Now;
            var timeElapsed = new TimeSpan((dateTimeNow - Properties.Settings.Default.UnusedDataCheck).Ticks);

            if (timeElapsed.TotalHours > ProjectSettings.IntervalHoursToDeleteUnusedPackages)
            {
                messagingService.ShowMessage("Очистка неиспользуемых пакетов...");
                loggerService.DebugLog("Очистка неиспользуемых пакетов...");

                var result = await convertingServerServiceFactory.UsingServiceRetry(service => service.Operations.DeleteAllUnusedPackagesUntilDate(dateTimeNow));

                if (result.HasErrors)
                {
                    messagingService.ShowAndLogErrors(result.Errors);
                }

                Properties.Settings.Default.UnusedDataCheck = new TimeSpan(dateTimeNow.Ticks);
                Properties.Settings.Default.Save();
            }
        }