|
@@ -138,7 +138,7 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
ErrorMsg = response.Success ? null :
|
|
|
(response.Exception == null ? response.Response : response.Exception.ToString())
|
|
|
});
|
|
|
- completecounter++;
|
|
|
+ Interlocked.Increment(ref completecounter);
|
|
|
}
|
|
|
|
|
|
});
|
|
@@ -156,8 +156,8 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
{
|
|
|
logger.Error("Assigned_StartTransactionCallbackTask Exception: " + ex.GetBaseException().ToString());
|
|
|
}
|
|
|
-
|
|
|
- ChargeRecordCallCounter++;
|
|
|
+ Interlocked.Increment(ref ChargeRecordCallCounter);
|
|
|
+
|
|
|
}, TaskCreationOptions.AttachedToParent);
|
|
|
|
|
|
|
|
@@ -229,9 +229,8 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
|
|
|
if (!string.IsNullOrEmpty(r.Fee) && string.IsNullOrEmpty(r.Receipt))
|
|
|
{
|
|
|
- //如果有計費但還沒結算 不回報給客戶
|
|
|
- completecounter++;
|
|
|
-
|
|
|
+ //如果有計費但還沒結算 不回報給客戶
|
|
|
+ Interlocked.Increment(ref completecounter);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -270,7 +269,8 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
ErrorMsg = response.Success ? null :
|
|
|
(response.Exception == null ? response.Response : response.Exception.ToString())
|
|
|
});
|
|
|
- completecounter++;
|
|
|
+ Interlocked.Increment(ref completecounter);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -298,7 +298,7 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
logger.Error("Assigned_StartTransactionCallbackTask Exception: " + ex.GetBaseException().ToString());
|
|
|
}
|
|
|
|
|
|
- ChargeRecordCallCounter++;
|
|
|
+ Interlocked.Increment(ref ChargeRecordCallCounter);
|
|
|
}, TaskCreationOptions.AttachedToParent);
|
|
|
|
|
|
|
|
@@ -398,8 +398,8 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
ReportedOn = DateTime.Now,
|
|
|
ErrorMsg = response.Success ? null :
|
|
|
(response.Exception == null ? response.Response : response.Exception.ToString())
|
|
|
- });
|
|
|
- completecounter++;
|
|
|
+ });
|
|
|
+ Interlocked.Increment(ref completecounter);
|
|
|
}
|
|
|
|
|
|
});
|
|
@@ -424,7 +424,7 @@ namespace EVCB_OCPP.TaskScheduler.Services
|
|
|
logger.Debug("Assigned_ReportExecutionofRemoteCommandTask Exception: " + ex.GetBaseException().ToString());
|
|
|
}
|
|
|
|
|
|
- ChargeRecordCallCounter++;
|
|
|
+ Interlocked.Increment(ref ChargeRecordCallCounter);
|
|
|
}, TaskCreationOptions.AttachedToParent);
|
|
|
|
|
|
|