mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-01 16:33:43 -04:00
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:
@ -1,12 +0,0 @@
|
||||
namespace Pulsar.Features.ShipLocker;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ShipLockerController(IShipLockerService shipLockerService) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Get()
|
||||
{
|
||||
return Ok(await shipLockerService.Get());
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ public class ShipLockerService(ILogger<ShipLockerService> logger, IOptions<Pulsa
|
||||
return new ShipLockerMaterials();
|
||||
}
|
||||
|
||||
public async Task HandleFile(string filePath)
|
||||
public async Task HandleFile(string filePath, CancellationToken token = new())
|
||||
{
|
||||
if (!FileHelper.ValidateFile(filePath))
|
||||
{
|
||||
@ -35,7 +35,7 @@ public class ShipLockerService(ILogger<ShipLockerService> logger, IOptions<Pulsa
|
||||
}
|
||||
|
||||
var file = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
var shipLocker = await JsonSerializer.DeserializeAsync<ShipLockerMaterials>(file);
|
||||
var shipLocker = await JsonSerializer.DeserializeAsync<ShipLockerMaterials>(file, cancellationToken: token);
|
||||
|
||||
if (shipLocker == null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user