/// <summary> /// Process the once file (if it exsits we rename it to usync.stop). /// </summary> private void ProcessOnceFile(string folder) { if (_syncFileService.FileExists($"{folder}/usync.once")) { _syncFileService.DeleteFile($"{folder}/usync.once"); _syncFileService.SaveFile($"{folder}/usync.stop", "uSync Stop file, prevents startup import"); _logger.LogInformation("usync.once file replaced by usync.stop file"); } }
private void ProcessOnceFile(string folder) { if (syncFileService.FileExists($"{folder}/usync.once")) { syncFileService.DeleteFile($"{folder}/usync.once"); syncFileService.SaveFile($"{folder}/usync.stop", "uSync Stop file, prevents startup import"); logger.Info <uSyncBackofficeComponent>("usync.once file replaced by usync.stop file"); } }
private int ClearHistory(string folder) { var count = 0; foreach (var historyFile in syncFileService.GetFiles(folder, "*.history")) { try { syncFileService.DeleteFile(historyFile); count++; } catch (Exception ex) { Logger.Warn <uSyncHistoryApiController>(ex, "Unable to delete {file}", historyFile); } } foreach (var subFolder in syncFileService.GetDirectories(folder)) { count += ClearHistory(subFolder); } return(count); }