diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs b/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs index 873440d2..d57a03fd 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs @@ -2,6 +2,6 @@ namespace Kalmit.PersistentProcess.WebHost { public class Program { - static public string AppVersionId => "2021-01-29"; + static public string AppVersionId => "2021-01-30"; } } diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs index eab85b52..855d7aa8 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs @@ -533,8 +533,12 @@ TruncateProcessHistoryReport truncateProcessHistory(TimeSpan productionBlockDura var totalStopwatch = System.Diagnostics.Stopwatch.StartNew(); + var filePathsInProcessStore = processStoreFileStore.ListFilesInDirectory(ImmutableList.Empty); + lock (avoidConcurrencyLock) { + var lockStopwatch = System.Diagnostics.Stopwatch.StartNew(); + var storeReductionStopwatch = System.Diagnostics.Stopwatch.StartNew(); var storeReductionReport = @@ -556,12 +560,12 @@ TruncateProcessHistoryReport truncateProcessHistory(TimeSpan productionBlockDura int deletedFilesCount = 0; - foreach (var filePath in processStoreFileStore.ListFilesInDirectory(ImmutableList.Empty)) + foreach (var filePath in filePathsInProcessStore) { if (filesForRestore.Contains(filePath)) continue; - if (productionBlockDurationLimit < totalStopwatch.Elapsed) + if (productionBlockDurationLimit < lockStopwatch.Elapsed) break; processStoreFileStore.DeleteFile(filePath); @@ -578,6 +582,7 @@ TruncateProcessHistoryReport truncateProcessHistory(TimeSpan productionBlockDura storeReductionReport = storeReductionReport, getFilesForRestoreTimeSpentMilli = (int)getFilesForRestoreStopwatch.ElapsedMilliseconds, deleteFilesTimeSpentMilli = (int)deleteFilesStopwatch.ElapsedMilliseconds, + lockedTimeSpentMilli = (int)lockStopwatch.ElapsedMilliseconds, totalTimeSpentMilli = (int)totalStopwatch.ElapsedMilliseconds, }; } @@ -738,6 +743,8 @@ public class TruncateProcessHistoryReport public int deletedFilesCount; + public int lockedTimeSpentMilli; + public int totalTimeSpentMilli; public int storeReductionTimeSpentMilli; diff --git a/implement/elm-fullstack/elm-fullstack.csproj b/implement/elm-fullstack/elm-fullstack.csproj index e1abc213..d83bd8fb 100644 --- a/implement/elm-fullstack/elm-fullstack.csproj +++ b/implement/elm-fullstack/elm-fullstack.csproj @@ -5,8 +5,8 @@ netcoreapp3.1 elm_fullstack elm-fullstack - 2021.0129.0.0 - 2021.0129.0.0 + 2021.0130.0.0 + 2021.0130.0.0