This commit is contained in:
2022-09-28 00:07:03 +00:00
parent 153978785c
commit f961991360
3 changed files with 5 additions and 3 deletions

View File

@@ -259,8 +259,8 @@ namespace AyaNova.Api.Controllers
/// </summary>
/// <param name="gid"></param>
/// <returns>Accepted</returns>
[HttpPost("request-cancel/{gid}")]
public async Task<IActionResult> RequestCancelJob([FromRoute] Guid gid)
[HttpPost("request-cancel")]
public async Task<IActionResult> RequestCancelJob([FromBody] Guid gid)
{
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));

View File

@@ -617,6 +617,7 @@ namespace AyaNova.Biz
{
break;
}
LastProgressCheck = DateTime.UtcNow;
}
SaveIt = false;
@@ -664,6 +665,7 @@ namespace AyaNova.Biz
await JobsBiz.LogJobAsync(job.GId, ExceptionUtil.ExtractAllExceptionMessages(ex));
}
}
await JobsBiz.UpdateJobProgressAsync(job.GId, $"{++CurrentRecord}/{TotalRecords}");
await JobsBiz.LogJobAsync(job.GId, $"LT:BatchJob {job.SubType} {idList.Count}{(FailedObjectCount > 0 ? " - LT:Failed " + FailedObjectCount : "")}");
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed);
}

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Util
//STATIC HARD CODED COMPILE TIME DEFAULTS NOT SET THROUGH CONFIG
internal const int FAILED_AUTH_DELAY = 3000;//ms
internal const int JOB_OBJECT_HANDLE_BATCH_JOB_LOOP_DELAY = 200;//ms this delay is a temporary measure to ensure super big time consuming batch jobs don't use all server CPU resources
internal const int JOB_PROGRESS_UPDATE_AND_CANCEL_CHECK_SECONDS = 15;//seconds between progress updates and checks for cancellation of long running jobs
internal const int JOB_PROGRESS_UPDATE_AND_CANCEL_CHECK_SECONDS = 5;//seconds between progress updates and checks for cancellation of long running jobs
//UPLOAD LIMITS 1048576 = 1MiB for testing 10737420000 10737418240 10,737,418,240
internal const long MAX_ATTACHMENT_UPLOAD_BYTES = 10737420000;//slight bit of overage as 10737418241=10GiB