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:
Alby96 committed 2026-10-27 09:56:47 +01:00
1 parent 422f33d5f3
commit e384564784
59 files changed
+668 -264

No files matched your search

-4
View File
@@ -21,7 +21,6 @@
<data name="Tooltips.Archive.Availability.Offline" xml:space="preserve"><value>Folder arsip tidak dapat dijangkau; indeks tetap seperti saat terakhir terlihat</value></data>
<data name="Tooltips.Archive.Availability.Online" xml:space="preserve"><value>Folder arsip dapat dijangkau dan ditulis</value></data>
<data name="Tooltips.Archive.Availability.ReadOnly" xml:space="preserve"><value>Dapat dibaca tetapi tidak dapat ditulis: hanya untuk menelusuri</value></data>
<data name="Tooltips.Archive.Backup" xml:space="preserve"><value>Tulis salinan konsisten basis data indeks ke folder cadangan; tiga cadangan terakhir disimpan</value></data>
<data name="Tooltips.Archive.Cameras" xml:space="preserve"><value>Foto per kamera; kamera dengan foto paling sedikit digabungkan</value></data>
<data name="Tooltips.Archive.CancelSearch" xml:space="preserve"><value>Hentikan pencarian; tidak ada yang berubah</value></data>
<data name="Tooltips.Archive.ClearFilter" xml:space="preserve"><value>Tampilkan lagi semua sekuens dalam pilihan</value></data>
@@ -72,7 +71,6 @@
<data name="Tooltips.Archive.RebuildStart" xml:space="preserve"><value>Antrekan pembangunan ulang · arsip tetap dapat digunakan selama proses</value></data>
<data name="Tooltips.Archive.Relink" xml:space="preserve"><value>Pilih folder baru dari arsip yang Anda pindahkan; sekuensnya ikut berpindah</value></data>
<data name="Tooltips.Archive.RenameApply" xml:space="preserve"><value>Terapkan tepat perubahan ini pada folder, sidecar, dan indeks · dilanjutkan jika aplikasi berhenti mendadak</value></data>
<data name="Tooltips.Archive.Restore" xml:space="preserve"><value>Pilih cadangan harian indeks di Pengaturan › Lanjutan; cadangan itu menggantikan indeks saat Chronos dimulai berikutnya</value></data>
<data name="Tooltips.Archive.RetagApply" xml:space="preserve"><value>Ubah tag sekuens ini di sidecar dan indeks</value></data>
<data name="Tooltips.Archive.Retry" xml:space="preserve"><value>Jalankan tindakan yang sama lagi</value></data>
<data name="Tooltips.Archive.Scan" xml:space="preserve"><value>Pemindaian inkremental: file baru, berubah, dan terhapus menurut waktu modifikasi dan ukuran</value></data>
@@ -539,8 +537,6 @@
<data name="Tooltips.Settings.AnalysisWidth" xml:space="preserve"><value>Sisi panjang terbesar saat bingkai didekode untuk analisis mendalam (setengah ukuran asli hingga batas ini); lebih lebar berarti lebih lambat tetapi melihat detail lebih halus</value></data>
<data name="Tooltips.Settings.ArchiveFree" xml:space="preserve"><value>Ruang kosong di drive arsip</value></data>
<data name="Tooltips.Settings.ArchiveRoot" xml:space="preserve"><value>Akar arsip lokal; file tidak dipindahkan · Enter menerapkan, Esc membatalkan</value></data>
<data name="Tooltips.Settings.Backup" xml:space="preserve"><value>Salin indeks ke folder cadangan; tiga cadangan terbaru disimpan · beberapa detik</value></data>
<data name="Tooltips.Settings.Backups" xml:space="preserve"><value>Salinan harian indeks (tiga yang terbaru disimpan); pilih salinan yang ingin dipulihkan</value></data>
<data name="Tooltips.Settings.BrowseArchive" xml:space="preserve"><value>Pilih folder arsip</value></data>
<data name="Tooltips.Settings.BrowseCache" xml:space="preserve"><value>Pilih folder cache; SSD yang cepat akan membantu</value></data>
<data name="Tooltips.Settings.CacheFolder" xml:space="preserve"><value>Tempat bingkai dilimpahkan dan gambar mini disimpan; SSD yang cepat akan membantu · Enter menerapkan, Esc membatalkan</value></data>