Fixup sonarqube

This commit is contained in:
Matt Gibson
2026-03-23 10:50:12 -07:00
parent 036268a830
commit bf73bfa52f
2 changed files with 8 additions and 3 deletions

View File

@@ -78,8 +78,13 @@ public class SeedController(
[HttpDelete]
public async Task<IActionResult> DeleteAllAsync([FromBody] DateTime? olderThanRequest)
{
var olderThan = olderThanRequest ?? DateTime.UtcNow.AddDays(-1);
logger.LogInformation("Deleting all seeded data older than {olderThan} UTC", olderThan);
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var olderThan = olderThanRequest?.ToUniversalTime() ?? DateTime.UtcNow.AddDays(-1);
logger.LogInformation("Deleting all seeded data older than {OlderThan} UTC", olderThan);
var playIds = getAllPlayIdsQuery.GetAllPlayIds(olderThan: olderThan);

View File

@@ -30,6 +30,6 @@ public class DeleteOldPlayDataJob : BaseJob
var olderThan = DateTime.UtcNow.AddDays(-1);
var playIds = _getAllPlayIdsQuery.GetAllPlayIds(olderThan);
await _destroyBatchScenesCommand.DestroyAsync(playIds);
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteOldPlayDataJob. Deleted {playIdCount} root items", playIds.Count);
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteOldPlayDataJob. Deleted {PlayIdCount} root items", playIds.Count);
}
}