- JobEngine: ISelectiveJobHandler lets a host decline jobs of a kind it runs; declined jobs stay queued for other claimers without holding up the rest. JobContext.EnqueueFollowUpAsync queues follow-up work on the same engine. - Server renders the jobs whose every output a managed encoder produces (ManagedRenderJobHandler); MP4 jobs stay for render nodes. Program.cs registers ProcessingModule next to ArchiveModule. Server renders ignore a client's export folder. - Light analysis is queued after imports and after scans that indexed new sequences, so the advisor's Auto values exist without user action. - Analysis jobs log a failing sequence and go on; the job then fails and a retry analyses only the failed ones. The advised frame rate follows the user's fit-to duration. - ProcessingJobs.RenderEach splits a batch into one job per preset for servers; render nodes say which batch presets they did not render, fetch each content once and stop on a changed certificate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
using System.ComponentModel;
|
|
using Titano.Server.Configuration;
|
|
using Titano.Server.Hosting;
|
|
using Titano.Server.Hosting.Windows;
|
|
using Titano.Server.Storage;
|
|
|
|
var command = ServerCommandLine.Parse(args);
|
|
if (command.Error is not null)
|
|
{
|
|
await Console.Error.WriteLineAsync(command.Error);
|
|
return 2;
|
|
}
|
|
|
|
switch (command.Command)
|
|
{
|
|
case ServerCommand.Help:
|
|
Console.WriteLine(ServerCommandLine.Usage);
|
|
return 0;
|
|
case ServerCommand.HealthCheck:
|
|
return await HealthProbe.RunAsync();
|
|
case ServerCommand.Service or ServerCommand.InstallService or ServerCommand.UninstallService when !OperatingSystem.IsWindows():
|
|
await Console.Error.WriteLineAsync("Windows services are available on Windows only.");
|
|
return 2;
|
|
case ServerCommand.InstallService when OperatingSystem.IsWindows():
|
|
return ServiceAction(ServiceInstaller.Install, $"Installed the {WindowsServiceHost.ServiceName} service.");
|
|
case ServerCommand.UninstallService when OperatingSystem.IsWindows():
|
|
return ServiceAction(ServiceInstaller.Uninstall, $"Removed the {WindowsServiceHost.ServiceName} service.");
|
|
case ServerCommand.Service when OperatingSystem.IsWindows():
|
|
if (WindowsServiceHost.Run(() => ServerHost.Build(ServerOptions.Load(), [.. command.HostArguments], RegisterModules))) return 0;
|
|
await Console.Error.WriteLineAsync("--service is used by the Service Control Manager; start the service with 'sc start TitanoServer'.");
|
|
return 1;
|
|
default:
|
|
var app = ServerHost.Build(ServerOptions.Load(), [.. command.HostArguments], RegisterModules);
|
|
await app.RunAsync();
|
|
return 0;
|
|
}
|
|
|
|
// The archive engine, then analysis and managed rendering over it.
|
|
static void RegisterModules(IServiceCollection services)
|
|
{
|
|
ArchiveModule.Register(services);
|
|
ProcessingModule.Register(services);
|
|
}
|
|
|
|
static int ServiceAction(Action action, string done)
|
|
{
|
|
try
|
|
{
|
|
action();
|
|
Console.WriteLine(done);
|
|
return 0;
|
|
}
|
|
catch (Win32Exception ex)
|
|
{
|
|
Console.Error.WriteLine(ex.Message);
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
/// <summary>Entry point type, visible to the in-process test host.</summary>
|
|
public partial class Program;
|