Journals Now processed in own thread

Some invalid journal data is now handled
Journals now use polymorphic deserialization
Added Event names to all journal events
Remove unused controllers
This commit is contained in:
Ben Parsons 2024-05-24 17:57:10 +10:00
commit efd0b3e0c0
297 changed files with 826 additions and 208 deletions

View file

@ -1,13 +0,0 @@
using Observatory.Framework.Files;
namespace Pulsar.Features.Cargo;
[ApiController]
[Route("api/[controller]")]
public class CargoController(ICargoService cargoService) : ControllerBase
{
public async Task<ActionResult<CargoFile>> Get()
{
return Ok(await cargoService.Get());
}
}

View file

@ -8,7 +8,7 @@ public class CargoService(IOptions<PulsarConfiguration> options, ILogger<CargoSe
{
public string FileName => "Cargo.json";
public async Task HandleFile(string filePath)
public async Task HandleFile(string filePath, CancellationToken token = new())
{
if (!FileHelper.ValidateFile(filePath))
{
@ -16,7 +16,7 @@ public class CargoService(IOptions<PulsarConfiguration> options, ILogger<CargoSe
}
var file = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var moduleInfo = await JsonSerializer.DeserializeAsync<CargoFile>(file);
var moduleInfo = await JsonSerializer.DeserializeAsync<CargoFile>(file, cancellationToken: token);
if (moduleInfo == null)
{