Scanner Fixes (#2800)

This commit is contained in:
Joe Milazzo 2024-03-19 18:48:42 -05:00 committed by GitHub
parent 123917fbec
commit 8167fc5a4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 462 additions and 203 deletions

View file

@ -221,18 +221,18 @@ public class ServerController : BaseApiController
/// </summary>
/// <returns></returns>
[HttpGet("jobs")]
public ActionResult<IEnumerable<JobDto>> GetJobs()
public async Task<ActionResult<IEnumerable<JobDto>>> GetJobs()
{
var recurringJobs = JobStorage.Current.GetConnection().GetRecurringJobs().Select(
dto =>
new JobDto() {
Id = dto.Id,
Title = dto.Id.Replace('-', ' '),
Cron = dto.Cron,
LastExecutionUtc = dto.LastExecution.HasValue ? new DateTime(dto.LastExecution.Value.Ticks, DateTimeKind.Utc) : null
});
var jobDtoTasks = JobStorage.Current.GetConnection().GetRecurringJobs().Select(async dto =>
new JobDto()
{
Id = dto.Id,
Title = await _localizationService.Translate(User.GetUserId(), dto.Id),
Cron = dto.Cron,
LastExecutionUtc = dto.LastExecution.HasValue ? new DateTime(dto.LastExecution.Value.Ticks, DateTimeKind.Utc) : null
});
return Ok(recurringJobs);
return Ok(await Task.WhenAll(jobDtoTasks));
}
/// <summary>