feat(server): run on the real archive engine
ArchiveModule registers the archive engine as the server's ingest, its proxy/thumbnail locator and its job handlers (through the new IJobHandlerProvider); Program.cs passes it to ServerHost.Build. The server opens its archive through ArchiveService so archive.json always exists. The server's path-safety helper is renamed ArchivePathGuard to stop clashing with the archive layout's ArchivePaths, and the server migration is renumbered 0003. An end-to-end test uploads a photo, finds it in the layout and fetches the thumbnail built by the queued job. CI's PostgreSQL jobs now run the server tests too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
15 files changed
+150
-22
No files matched your search
@@ -13,7 +13,7 @@ namespace Titano.Data.Archiving;
|
||||
/// or adopt an archive, plan and apply mass renames, plan imports and card erases, query duplicates and orphans, and
|
||||
/// the job handlers for the long operations (enqueue them with <see cref="ArchiveJobs"/>).
|
||||
/// </summary>
|
||||
public sealed class ArchiveService
|
||||
public sealed class ArchiveService : IJobHandlerProvider
|
||||
{
|
||||
private readonly TitanoDatabase _db;
|
||||
private readonly SequenceWriter _writer;
|
||||
|
||||
@@ -13,6 +13,12 @@ public interface IJobHandler
|
||||
Task RunAsync(JobContext context);
|
||||
}
|
||||
|
||||
/// <summary>A component that brings several handlers (the archive engine: scan, rebuild, verify, import, images, maintenance).</summary>
|
||||
public interface IJobHandlerProvider
|
||||
{
|
||||
IReadOnlyList<IJobHandler> CreateJobHandlers();
|
||||
}
|
||||
|
||||
/// <summary>Live progress of a running job (pushed to the job bar, the Jobs screen and WebSocket clients).</summary>
|
||||
public sealed record JobProgressInfo(Guid JobId, JobKind Kind, string? TargetLabel, long Done, long Total, double? ItemsPerSecond, TimeSpan? Eta, string? Message);
|
||||
|
||||
|
||||
Reference in new issue
Block a user