This commit is contained in:
@@ -212,29 +212,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get route that submits a simulated long running operation job for testing
|
||||
/// </summary>
|
||||
/// <returns>Nothing</returns>
|
||||
[HttpGet("testwidgetjob")]
|
||||
public async Task<IActionResult> TestWidgetJob()
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
if (!Authorized.HasModifyRole(HttpContext.Items, AyaType.ServerJob))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
//Create the job here
|
||||
OpsJob j = new OpsJob();
|
||||
j.Name = "TestWidgetJob";
|
||||
j.JobType = JobType.TestWidgetJob;
|
||||
await JobsBiz.AddJobAsync(j, ct);
|
||||
//Log
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerJob, AyaEvent.Created, $"{j.JobType} {j.Name}"), ct);
|
||||
|
||||
return Accepted(new { JobId = j.GId });//202 accepted
|
||||
}
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user