feat: owner review 2 phase 2: scheduled jobs and log settings (#10)
CI / Build and test (push) Successful in 7m0s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 13m28s
CI / PostgreSQL 16 integration (push) Successful in 5m52s
CI / PostgreSQL 17 integration (push) Successful in 4m50s
CI / Docker image (push) Successful in 1m4s
Release / Server image (push) Successful in 1m35s

- Jobs > Scheduled on the desktop and the admin panel. Every timer that queued work is now a visible system schedule: archive scan, upload clean-up, index backup, job-history and audit clean-ups, desktop housekeeping. New actions: verify, thumbnails, proxies, analysis, maintenance, backup, clean-ups, reports.
- The scheduler: migration 0007, in-house recurrence, compare-and-set claim, catch-up, scan at start.
- Log settings: levels, retention, size parts, total limit, daily or hourly rotation, audit retention, diagnostics share; the server writes Debug/Trace to its files again; logging never fails a job.

Upgrade: CHRONOS_LOG_LEVEL set in an existing container locks both levels; migration 0007 is one-way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #10.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-10-27 11:19:26 +01:00
1 parent 1f089888e8
commit af9eeaab9b
349 files changed
+28341 -1304

No files matched your search

+13 -2
View File
@@ -41,7 +41,9 @@ public partial class App : Application
var capture = captureIndex >= 0;
// Capture never reads or writes the user's data folder.
Environment = capture ? AppEnvironment.ForCapture() : AppEnvironment.Detect();
_log = new FileLogSink(Environment.LogDirectory, "chronos");
// Settings › Advanced › Logs from the first line, which prunes the folder: also a launch that only hands over. The
// settings are read again once this launch owns the data folder, since a Chronos that was closing saves them on exit.
_log = AppLogging.Open(Environment.LogDirectory, capture ? new AppSettings() : AppSettings.Load(Environment.SettingsPath));
// Capture runs in CI: mirror the log to stderr so failures are visible in the job output.
Log.SetSink(capture ? new TeeLogSink(_log, new StderrLogSink()) : _log);
Log.Info("app", $"Chronos {AppServices.VersionText} starting; data at {Environment.DataDirectory}");
@@ -77,6 +79,7 @@ public partial class App : Application
}
Settings = capture ? new AppSettings { Language = "en" } : AppSettings.Load(Environment.SettingsPath);
ApplyLogSettings();
UiLanguage.Apply(Settings.Language);
ThemeManager.Initialize(this, capture ? AppTheme.Dark : Settings.Theme);
AppResources.Merge(this);
@@ -182,7 +185,7 @@ public partial class App : Application
public void SaveSettings()
{
// A launch that handed over to the running Chronos exits before loading any settings.
// A launch that handed over to the running Chronos reads the settings only for its log and never sets Settings.
if (Settings is null) return;
try
{
@@ -192,6 +195,14 @@ public partial class App : Application
{
Log.Warning("app", "Settings not saved", ex);
}
// Every settings change passes here, Settings › Advanced › Logs, its Reset and an imported file included.
ApplyLogSettings();
}
/// <summary>Settings › Advanced › Logs to the log files, from the next line on (owner review 2, R11).</summary>
private void ApplyLogSettings()
{
if (_log is not null) AppLogging.Apply(_log, Settings);
}
protected override void OnExit(ExitEventArgs e)