Owner review 1, phase 2 (docs/requests/2026-10-15-owner-review-1.md, R2). Jobs now run one at a time on the desktop and on the server. Parallelism (Settings > Rendering, TITANO_PARALLELISM) is how many photos the running job processes at once: thumbnail and proxy passes draw that many photos together and still write the pack and checkpoints in frame order, decode tiers are probed that many at a time, the deep analysis measures that many frames and a render decodes that many ahead. Wherever originals are developed whole (TIFF, PNG, RAW without a usable preview), fewer run at once within the memory budget, which the running job now has whole; the server's frame window is sized to the host instead of 1 GiB. A new job waits its turn and pausing the running job starts the next one. An optional priority queue gives each job kind a level (renders, imports and downloads high, verifies and proxies low by default): a queued job of a higher level pauses the running one without asking, and that job goes back to the queue with its checkpoint and resumes by itself afterwards. Jobs of the same level, and a job's own follow-ups, never interrupt it. The Jobs screen and the admin panel show the parallelism and the queue; Settings > Rendering and the admin panel's Settings set them, at once. TITANO_WORKERS and the Workers key of server.json still set the parallelism (1 to 64, with a warning at start for the variable). Titano.Tools gains i18n prune, which removed the renamed keys from the 36 machine-translated languages; the new strings are translated in all 38. Found while testing: uploads and imports failed when a pass read the sidecar while they wrote it (atomic writes now retry the rename while a reader holds the file, and never for a read-only one), and taking a lease just released while another process read it failed on Windows (the create now waits for the reader). Five adversarial review rounds checked the phase before this commit. Also updates BRIEF (12.8, 14.6, 14.8, 14.9, 24), DECISIONS, CHANGELOG, ARCHITECTURE, STATUS, the request file and the compose/Unraid templates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.9 KiB
C#
38 lines
1.9 KiB
C#
using Titano.Core.Imaging.Decoders;
|
|
using Titano.Data;
|
|
using Titano.Data.Archiving;
|
|
using Titano.Data.Jobs;
|
|
using Titano.Server.Configuration;
|
|
|
|
namespace Titano.Server.Storage;
|
|
|
|
/// <summary>
|
|
/// The archive engine behind the server (BRIEF §7, §14.4): ingest of verified uploads, lookup of proxies and
|
|
/// thumbnails, its job handlers (scan, rebuild, verify, import, thumbnails, proxies, maintenance) and the periodic
|
|
/// incremental scan (<see cref="ArchivePolling"/>); a scan queues thumbnails and proxies of what it indexes, as an upload
|
|
/// does. Decoding is managed only (BRIEF §4.2). The daily backup of an SQLite index runs with it
|
|
/// (<see cref="DatabaseBackupService"/>).
|
|
/// </summary>
|
|
public static class ArchiveModule
|
|
{
|
|
/// <summary>Name the server writes into the archive's lease files.</summary>
|
|
public static string Owner { get; } = "server@" + Environment.MachineName;
|
|
|
|
public static void Register(IServiceCollection services)
|
|
{
|
|
services.AddSingleton(sp =>
|
|
{
|
|
var options = sp.GetRequiredService<ServerOptions>();
|
|
// Photos the running job processes at once: the settings' value as it is when each sequence starts (owner review 1).
|
|
return new ArchiveService(sp.GetRequiredService<TitanoDatabase>(),
|
|
new ArchiveServiceOptions { Decoder = DecoderFactory.CreateServer(), Owner = Owner, ImagesAfterScan = true, Parallelism = () => options.Parallelism });
|
|
});
|
|
services.AddSingleton<IArchiveIngest>(sp => sp.GetRequiredService<ArchiveService>().Ingest);
|
|
services.AddSingleton<IJobHandlerProvider>(sp => sp.GetRequiredService<ArchiveService>());
|
|
services.AddSingleton<IFrameAssetLocator, ArchiveAssetLocator>();
|
|
services.AddHostedService<DatabaseBackupService>();
|
|
services.AddSingleton<ArchivePolling>();
|
|
services.AddHostedService(sp => sp.GetRequiredService<ArchivePolling>());
|
|
}
|
|
}
|