From 2b8077a723f0797531978b74393c8c18b7149f0e Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Thu, 23 Nov 2023 14:57:04 +0500 Subject: [PATCH] Fix background work counters --- AsbCloudApp/Data/BackgroundWorkDto.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Data/BackgroundWorkDto.cs b/AsbCloudApp/Data/BackgroundWorkDto.cs index 3374148c..500f818a 100644 --- a/AsbCloudApp/Data/BackgroundWorkDto.cs +++ b/AsbCloudApp/Data/BackgroundWorkDto.cs @@ -180,12 +180,12 @@ namespace AsbCloudApp.Data /// protected void SetStatusComplete() { + CountComplete++; if (CurrentState is null) return; LastComplete = new(CurrentState); CurrentState = null; - CountComplete++; Trace.TraceInformation($"{WorkNameForTrace} state: completed"); } @@ -194,12 +194,12 @@ namespace AsbCloudApp.Data /// protected void SetLastError(string errorMessage) { + CountErrors++; if (CurrentState is null) return; LastError = new LastErrorInfo(CurrentState, errorMessage); CurrentState = null; - CountErrors++; Trace.TraceError($"{WorkNameForTrace} throw exception[{CountErrors}]: {errorMessage}"); } }