This commit is contained in:
2020-05-13 18:35:43 +00:00
parent 17b4658ba0
commit da716b7cb0

View File

@@ -285,11 +285,21 @@ namespace AyaNova.Biz
#region PROCESSOR #region PROCESSOR
static bool ActivelyProcessing = false;
/// <summary> /// <summary>
/// Process all jobs (stock jobs and those found in operations table) /// Process all jobs (stock jobs and those found in operations table)
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
internal static async Task ProcessJobsAsync(AyContext ct, AyaNova.Api.ControllerHelpers.ApiServerState serverState) internal static async Task ProcessJobsAsync(AyContext ct, AyaNova.Api.ControllerHelpers.ApiServerState serverState)
{
if (ActivelyProcessing)
{
log.LogTrace("ProcessJobs called but actively processing other jobs so returning");
return;
}
ActivelyProcessing = true;
try
{ {
//Flush metrics report before anything else happens //Flush metrics report before anything else happens
log.LogTrace("Flushing metrics to reporters"); log.LogTrace("Flushing metrics to reporters");
@@ -365,7 +375,16 @@ namespace AyaNova.Biz
//Notifications //Notifications
}
catch (Exception ex)
{
log.LogError(ex, "JobsBiz::ProcessJobsAsync unexpected error during processing");
//todo: alert OPS
}
finally
{
ActivelyProcessing = false;
}
} }