fix: logging never fails a job, one backup retention, first copy after the upgrade
Owner review 2, phase 2 review findings (scheduler core). - Log.Write caught only IOException. Microsoft.Extensions.Logging wraps provider failures in an AggregateException, so a log line that could not be written (in tests: the process-wide sink of a stopped server whose log folder was gone) escaped JobEngine.RunAsync's catch before the failure was stored: the job stayed running and the worker faulted. This was the cause of the intermittent JobApiTests/ArchiveModuleTests failures. Log.Write now drops any non-fatal sink failure, TeeLogSink keeps a line from the other sinks, FileLogSink drops a line it cannot write and reopens the file at the next one, and LoggerSink drops what the providers throw. The scheduler's loop relies on the same guarantee. - The daily backup loop (RunDailyAsync, IsDue, Interval, CheckInterval) had no caller since the index-backup schedule replaced it; it is removed and the DatabaseBackups summary describes the schedule. - The first copy after the upgrade no longer waits a day (or for 03:00): SystemSchedule.LastDone seeds a new row due at once when its work was last done a period or more before, and both hosts pass the newest copy in the backups folder for index-backup. - Back up now (Settings and Archive), the copy kept before a restore and a backup job that keeps fewer prune to the largest Copies kept of the backup schedules (DatabaseBackups.KeptAsync), not a fixed three. The four tooltips that promised three daily copies are reworded (en, it) and their stale translations deleted. - New tests for the scheduler loop itself: a tick, Wake, a pass that threw, and dispose during a pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit c5ad0c4c3f636129afe5dd1ce039185516da5621)
This commit is contained in:
1 parent
422f33d5f3
commit
e384564784
59 files changed
+668
-264
No files matched your search
@@ -45,7 +45,10 @@ public interface IScheduleHost
|
||||
/// <summary>
|
||||
/// A host's system schedule: <paramref name="SystemKey"/> identifies it across starts (<c>archive-scan</c>,
|
||||
/// <c>index-backup</c>, <c>housekeeping</c>…); the rest is what it is seeded with and reset to. <paramref name="Name"/> is
|
||||
/// stored as given; clients show system schedules by their key in the user's language.
|
||||
/// stored as given; clients show system schedules by their key in the user's language. <paramref name="LastDone"/> is when
|
||||
/// the host last did this work before the schedule existed (the newest index copy, made by the timer the schedule
|
||||
/// replaced): seeded a whole period or more later, the row is due at once, so the upgrade's first start does the work
|
||||
/// as that timer would have; otherwise, and without it, the first run is the recurrence's first occurrence.
|
||||
/// </summary>
|
||||
public sealed record SystemSchedule(
|
||||
string SystemKey,
|
||||
@@ -55,4 +58,5 @@ public sealed record SystemSchedule(
|
||||
ScheduleParametersDto? Parameters = null,
|
||||
bool Enabled = true,
|
||||
bool CatchUp = true,
|
||||
JobPriority Priority = JobPriority.Background);
|
||||
JobPriority Priority = JobPriority.Background,
|
||||
DateTimeOffset? LastDone = null);
|
||||
Reference in new issue
Block a user