This commit is contained in:
Zeeshaun
2026-03-24 15:26:03 -05:00
parent 1e5beb292a
commit 9cc87337b8
333 changed files with 17931 additions and 0 deletions
@@ -0,0 +1,42 @@
using LCU.Api.Internal.Dispatcher.Services.DispatcherOperationServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading;
namespace LCU.Api.Internal.Dispatcher.Controllers;
[ApiController]
[Route("api/[controller]")]
public class CleanUpJobProcessController : ControllerBase
{
private readonly ICleanUpJobsService _cleanUpJobsService;
public CleanUpJobProcessController(ICleanUpJobsService cleanUpJobsService)
{
_cleanUpJobsService = cleanUpJobsService;
}
[HttpPost("RunCleanUpJobProcessNow", Name = "RunCleanUpJobProcessNow")]
[ProducesResponseType(200)]
[ProducesResponseType(500)]
public async Task<IActionResult> RunCleanUpJobNow()
{
try
{
Log.Information("Manually Kicked Off Dispatcher's Clean Up Job Hosted Service.");
var token = new CancellationToken();
await _cleanUpJobsService.PerformCleanUpJobs(token);
return Ok();
}
catch (ServiceException)
{
return StatusCode(StatusCodes.Status500InternalServerError);
}
catch (Exception exception)
{
Log.Error(exception, "Unexpected Exception");
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
}