From e384564784063f49a4c35da82f2ab0ae8d5fc8a5 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 27 Oct 2026 09:43:30 +0100 Subject: [PATCH] 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 (cherry picked from commit c5ad0c4c3f636129afe5dd1ce039185516da5621) --- docs/ARCHITECTURE.md | 4 +- i18n/ar/Tooltips.ar.resx | 4 - i18n/bg/Tooltips.bg.resx | 4 - i18n/cs/Tooltips.cs.resx | 4 - i18n/da/Tooltips.da.resx | 4 - i18n/de/Tooltips.de.resx | 4 - i18n/el/Tooltips.el.resx | 4 - i18n/en/Tooltips.resx | 8 +- i18n/es/Tooltips.es.resx | 4 - i18n/et/Tooltips.et.resx | 4 - i18n/fi/Tooltips.fi.resx | 4 - i18n/fr/Tooltips.fr.resx | 4 - i18n/he/Tooltips.he.resx | 4 - i18n/hi/Tooltips.hi.resx | 4 - i18n/hr/Tooltips.hr.resx | 4 - i18n/hu/Tooltips.hu.resx | 4 - i18n/id/Tooltips.id.resx | 4 - i18n/it/Tooltips.it.resx | 8 +- i18n/ja/Tooltips.ja.resx | 4 - i18n/ko/Tooltips.ko.resx | 4 - i18n/lt/Tooltips.lt.resx | 4 - i18n/lv/Tooltips.lv.resx | 4 - i18n/ms/Tooltips.ms.resx | 4 - i18n/nb/Tooltips.nb.resx | 4 - i18n/nl/Tooltips.nl.resx | 4 - i18n/pl/Tooltips.pl.resx | 4 - i18n/pt-BR/Tooltips.pt-BR.resx | 4 - i18n/pt-PT/Tooltips.pt-PT.resx | 4 - i18n/ro/Tooltips.ro.resx | 4 - i18n/ru/Tooltips.ru.resx | 4 - i18n/sk/Tooltips.sk.resx | 4 - i18n/sl/Tooltips.sl.resx | 4 - i18n/sv/Tooltips.sv.resx | 4 - i18n/th/Tooltips.th.resx | 4 - i18n/tr/Tooltips.tr.resx | 4 - i18n/uk/Tooltips.uk.resx | 4 - i18n/vi/Tooltips.vi.resx | 4 - i18n/zh-Hans/Tooltips.zh-Hans.resx | 4 - i18n/zh-Hant/Tooltips.zh-Hant.resx | 4 - src/Chronos.App/Jobs/DesktopScheduleHost.cs | 10 +- src/Chronos.App/Sections/ArchiveViewModel.cs | 2 +- src/Chronos.App/Sections/SettingsViewModel.cs | 9 +- src/Chronos.Core/Diagnostics/FileLogSink.cs | 28 ++- src/Chronos.Core/Diagnostics/Log.cs | 25 ++- src/Chronos.Data/Archiving/ArchiveService.cs | 3 + src/Chronos.Data/DatabaseBackups.cs | 83 ++++---- .../Housekeeping/HousekeepingJobHandlers.cs | 8 +- .../Repositories/ScheduleRepository.cs | 10 +- src/Chronos.Data/Scheduling/IScheduleHost.cs | 8 +- .../Hosting/FileLoggerProvider.cs | 10 +- src/Chronos.Server/Jobs/ServerScheduleHost.cs | 7 +- .../Jobs/DesktopScheduleHostTests.cs | 25 +++ .../Diagnostics/FileLogSinkTests.cs | 25 +++ .../Diagnostics/LogTests.cs | 70 +++++++ .../Jobs/LoggingFailureTests.cs | 133 +++++++++++++ .../Scheduling/HousekeepingJobTests.cs | 6 + .../Scheduling/SchedulerTests.cs | 188 +++++++++++++++++- .../Sqlite/DatabaseBackupsTests.cs | 92 +++++---- .../Storage/ArchiveModuleTests.cs | 26 +++ 59 files changed, 668 insertions(+), 264 deletions(-) create mode 100644 tests/Chronos.Core.Tests/Diagnostics/LogTests.cs create mode 100644 tests/Chronos.Data.Tests/Jobs/LoggingFailureTests.cs diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 9c264a0f..e22411ff 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -45,7 +45,7 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | `Naming` | Folder/file templates and tokens | | `Model` | Domain entities and enums (§5) shared by Data, Server and clients | | `Packaging` | TPK1 installer payload writer/reader, staged install transaction | -| `Diagnostics` | `Log`, `FileLogSink` with `LogFileOptions` (level, daily or hourly files, numbered parts past a size, pruning by age and by the total size, never the file being written), synthetic sequences, `SecretScrubber`, `DiagnosticsArchive` (scrubbed diagnostics zip) | +| `Diagnostics` | `Log` (never throws: a line its sink cannot write is dropped), `FileLogSink` with `LogFileOptions` (level, daily or hourly files, numbered parts past a size, pruning by age and by the total size, never the file being written), synthetic sequences, `SecretScrubber`, `DiagnosticsArchive` (scrubbed diagnostics zip) | | `Localization`, `IO`, `Hashing`, `Branding` | `Loc`/plural rules, `AtomicFile`, `StartupCommand` (sign-in entries of the programs, moved or removed by setup), CRC-32/SHA helpers, brand mark geometry | ### 2.2 Chronos.Data @@ -54,7 +54,7 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S |---|---| | `Sqlite`, `Postgres` | SQLite P/Invoke binding (winsqlite3 / libsqlite3), in-house PostgreSQL wire protocol v3 client with pool and LISTEN | | `Migrations/{sqlite,postgres}/NNNN_name.sql` | Embedded, applied in one transaction at open (`MigrationRunner`) | -| `Repositories` | `ChronosDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit, schedules (`ScheduleRepository`: system rows seeded without overwriting edits and never deleted, the compare-and-set claim of a run); `DatabaseBackups` (`VACUUM INTO` copies of an SQLite index into `backups` next to it, restore staged for the next start and carried out before the index opens, so it also recovers one that no longer opens) | +| `Repositories` | `ChronosDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit, schedules (`ScheduleRepository`: system rows seeded without overwriting edits and never deleted, the compare-and-set claim of a run); `DatabaseBackups` (`VACUUM INTO` copies of an SQLite index into `backups` next to it, every copy keeping as many as the backup schedules keep (`KeptAsync`), the newest copy that seeds the `index-backup` schedule (`Newest`, `SystemSchedule.LastDone`), restore staged for the next start and carried out before the index opens, so it also recovers one that no longer opens) | | `Jobs` | `JobEngine` (one job at a time; reviews the priority queue and makes a lower running job yield, requeued with its checkpoint; no history purge, the housekeeping schedule's clean-up does it), `JobPriorityQueue` (a level per job kind, the claim order, settings round trip), `IJobHandler`, `IJobHandlerProvider`, `JobContext` (progress, checkpoints, follow-up jobs that never interrupt their parent), `JobThroughput`/`JobEta` (rate and bounded time left) | | `Scheduling` | `Scheduler` (one per host: seeds the host's system schedules, claims due runs by compare-and-set, catch-up, clock changes, create/edit/reset/delete/run now as API v1 DTOs), `ScheduleRecurrence` (the in-house `every:`/`daily:`/`weekly:`/`monthly:` form, wall-clock times across DST), `ScheduleActions` (action names, parameters, availability, the archive jobs a run queues), `IScheduleHost` and `SystemSchedule` (what the server and the desktop supply), `ScheduleOutcome`, `ScheduleMapping` (model ↔ DTO) | | `Housekeeping` | `BackupJobHandler`, `CleanupJobHandler`, `ICleanupStep` with the shared steps (`CleanupSteps`: job history, audit log, trash report that never deletes); hosts add their own steps through `ArchiveServiceOptions.CleanupSteps` | diff --git a/i18n/ar/Tooltips.ar.resx b/i18n/ar/Tooltips.ar.resx index 0bebab70..7c36a4ee 100644 --- a/i18n/ar/Tooltips.ar.resx +++ b/i18n/ar/Tooltips.ar.resx @@ -21,7 +21,6 @@ يتعذر الوصول إلى مجلد الأرشيف؛ ويبقى الفهرس كما كان في آخر مرة مجلد الأرشيف متاح وقابل للكتابة قابل للقراءة لا للكتابة: للاستعراض فقط - كتابة نسخة متسقة من قاعدة بيانات الفهرس في مجلد النسخ الاحتياطية؛ يُحتفظ بآخر ثلاث نسخ الصور حسب الكاميرا؛ وتُجمع الكاميرات الأقل صورًا معًا إيقاف البحث؛ لم يتغير شيء إظهار كل تسلسلات التحديد مجددًا @@ -74,7 +73,6 @@ إضافة إعادة البناء إلى قائمة الانتظار · يبقى الأرشيف قابلًا للاستخدام في أثناء ذلك اختيار المجلد الجديد لأرشيف نقلته؛ وتتبعه تسلسلاته إجراء هذه التغييرات بالضبط على المجلدات والملفات المرافقة والفهرس · يُستأنف بعد أي تعطل مفاجئ - اختيار نسخة احتياطية يومية من الفهرس في «الإعدادات › متقدم»؛ تحل محل الفهرس عند البدء التالي تغيير وسوم هذه التسلسلات في الملفات المرافقة والفهرس تشغيل الإجراء نفسه مجددًا فحص تزايدي: الملفات الجديدة والمتغيرة والمزالة حسب وقت التعديل والحجم @@ -575,8 +573,6 @@ أكبر طول للضلع الطويل يُفك به ترميز الإطارات للتحليل المعمّق (نصف الحجم الأصلي حتى هذه القيمة)؛ العرض الأكبر أبطأ لكنه يرى تفاصيل أدق المساحة المتاحة على محرك أقراص الأرشيف جذر الأرشيف المحلي؛ لا تُنقل الملفات · Enter للتطبيق، Esc للتراجع - نسخ الفهرس إلى مجلد النسخ الاحتياطية؛ يُحتفظ بأحدث ثلاث نسخ · بضع ثوانٍ - نسخ يومية من الفهرس (يُحتفظ بأحدث ثلاث نسخ)؛ اختر النسخة التي تريد العودة إليها اختيار مجلد الأرشيف اختيار مجلد التخزين المؤقت؛ يفيد استخدام قرص SSD سريع المكان الذي تُفرَغ فيه الإطارات وتُحفظ فيه الصور المصغرة؛ يفيد استخدام قرص SSD سريع · Enter للتطبيق، Esc للتراجع diff --git a/i18n/bg/Tooltips.bg.resx b/i18n/bg/Tooltips.bg.resx index 1582ec4a..1ba11b53 100644 --- a/i18n/bg/Tooltips.bg.resx +++ b/i18n/bg/Tooltips.bg.resx @@ -21,7 +21,6 @@ Папката на архива е недостъпна; индексът остава такъв, какъвто е бил при последната проверка Папката на архива е достъпна и позволява запис Може да се чете, но не и да се записва: само разглеждане - Записва съгласувано копие на базата данни на индекса в папката с резервни копия; пазят се последните три Снимки по фотоапарат; най-малките са обединени в група Спира търсенето; нищо не е променено Показва отново всички серии от избора @@ -72,7 +71,6 @@ Поставя преизграждането на опашка · междувременно архивът остава използваем Избира новата папка на архив, който сте преместили; сериите му го следват Прилага точно тези промени към папките, sidecar файловете и индекса · продължава след срив - Изберете ежедневно резервно копие на индекса в Настройки › Разширени; то заменя индекса при следващото стартиране Променя етикетите на тези серии в sidecar файловете и индекса Изпълнява същото действие отново Инкрементално сканиране: нови, променени и премахнати файлове по час на промяна и размер @@ -539,8 +537,6 @@ Най-голямата дълга страна, до която кадрите се декодират за задълбочен анализ (половината от собствения размер, но не повече от това); по-голямата стойност е по-бавна и вижда по-фини детайли Свободно място на устройството на архива Корен на локалния архив; файловете не се преместват · Enter прилага, Esc връща - Копира индекса в папката с резервни копия; пазят се последните три · няколко секунди - Ежедневни копия на индекса (пазят се последните три); изберете към кое да се върнете Избор на папката на архива Избор на папката на кеша; бърз SSD помага Къде се изместват кадрите и се пазят миниатюрите; бърз SSD помага · Enter прилага, Esc връща diff --git a/i18n/cs/Tooltips.cs.resx b/i18n/cs/Tooltips.cs.resx index d1f9e4c9..68f4dc86 100644 --- a/i18n/cs/Tooltips.cs.resx +++ b/i18n/cs/Tooltips.cs.resx @@ -21,7 +21,6 @@ Složka archivu není dostupná; index zůstává ve stavu z poslední kontroly Složka archivu je dostupná a zapisovatelná Lze číst, ale ne zapisovat: jen procházení - Zapíše konzistentní kopii databáze indexu do složky záloh; uchovávají se poslední tři Fotografie podle fotoaparátu; nejmenší skupiny jsou sloučeny Zastaví hledání; nic se nezměnilo Znovu zobrazí všechny sekvence výběru @@ -73,7 +72,6 @@ Zařadí sestavení indexu do fronty · archiv zůstane mezitím použitelný Vybere novou složku přesunutého archivu; cesty k jeho sekvencím se aktualizují Provede přesně tyto změny ve složkách, doprovodných souborech a indexu · po pádu aplikace pokračuje - Denní zálohu indexu vyberete v Nastavení › Pokročilé; nahradí index při příštím spuštění Změní značky těchto sekvencí v doprovodných souborech a v indexu Spustí stejnou akci znovu Přírůstkové prohledání: nové, změněné a odebrané soubory podle času změny a velikosti @@ -557,8 +555,6 @@ Největší délka delší strany, na kterou se snímky dekódují pro hloubkovou analýzu (polovina nativní velikosti, nejvýše tato hodnota); vyšší hodnota je pomalejší, ale zachytí jemnější detaily Volné místo na jednotce archivu Kořen místního archivu; soubory se nepřesouvají · Enter použije, Esc vrátí zpět - Zkopíruje index do složky záloh; uchovávají se tři nejnovější · několik sekund - Denní kopie indexu (uchovávají se tři nejnovější); vyberte tu, ke které se chcete vrátit Otevře výběr složky archivu Otevře výběr složky mezipaměti; pomůže rychlý SSD Kam se odkládají snímky a ukládají miniatury; pomůže rychlý SSD · Enter použije, Esc vrátí zpět diff --git a/i18n/da/Tooltips.da.resx b/i18n/da/Tooltips.da.resx index bd505353..074128d1 100644 --- a/i18n/da/Tooltips.da.resx +++ b/i18n/da/Tooltips.da.resx @@ -21,7 +21,6 @@ Arkivmappen kan ikke nås; indekset forbliver, som det sidst blev set Arkivmappen kan nås og er skrivbar Kan læses, men ikke skrives til: kun gennemsyn - Skriv en konsistent kopi af indeksdatabasen til mappen med sikkerhedskopier; de tre seneste bevares Fotos pr. kamera; de mindste grupperes Stop søgningen; intet er ændret Vis alle sekvenser i markeringen igen @@ -72,7 +71,6 @@ Sæt genopbygningen i kø · arkivet kan bruges imens Vælg den nye mappe for et arkiv, du har flyttet; dets sekvenser følger med Foretag præcis disse ændringer i mapper, sidecar-filer og indeks · genoptages efter et nedbrud - Vælg en daglig sikkerhedskopi af indekset under Indstillinger › Avanceret; den erstatter indekset ved næste start Skift tags for disse sekvenser i sidecar-filer og indeks Kør den samme handling igen Trinvis scanning: nye, ændrede og fjernede filer efter ændringstidspunkt og størrelse @@ -539,8 +537,6 @@ Største længde af den lange side, når billeder afkodes til dybdeanalyse (halvdelen af den oprindelige størrelse, dog højst denne); bredere er langsommere og ser finere detaljer Ledig plads på arkivdrevet Roden af det lokale arkiv; filer flyttes ikke · Enter anvender, Esc fortryder - Kopiér indekset til mappen med sikkerhedskopier; de tre nyeste bevares · et par sekunder - Daglige kopier af indekset (de tre nyeste bevares); vælg den, du vil vende tilbage til Vælg arkivmappen Vælg cachemappen; en hurtig SSD hjælper Hvor billeder lægges ud, og miniaturer gemmes; en hurtig SSD hjælper · Enter anvender, Esc fortryder diff --git a/i18n/de/Tooltips.de.resx b/i18n/de/Tooltips.de.resx index 954cabb6..3c598d94 100644 --- a/i18n/de/Tooltips.de.resx +++ b/i18n/de/Tooltips.de.resx @@ -21,7 +21,6 @@ Der Archivordner ist nicht erreichbar; der Index bleibt auf dem zuletzt gesehenen Stand Der Archivordner ist erreichbar und beschreibbar Lesbar, aber nicht beschreibbar: nur Durchsehen möglich - Konsistente Kopie der Indexdatenbank in den Sicherungsordner schreiben; die letzten drei werden behalten Fotos pro Kamera; die kleinsten werden zusammengefasst Suche beenden; es wurde nichts geändert Wieder alle Sequenzen der Auswahl anzeigen @@ -72,7 +71,6 @@ Neuaufbau einreihen · das Archiv bleibt währenddessen nutzbar Neuen Ordner eines verschobenen Archivs auswählen; seine Sequenzen folgen Genau diese Änderungen an Ordnern, Sidecar-Dateien und Index vornehmen · wird nach einem Absturz fortgesetzt - Eine tägliche Sicherung des Index unter Einstellungen › Erweitert auswählen; sie ersetzt den Index beim nächsten Start Tags dieser Sequenzen in Sidecar-Dateien und Index ändern Dieselbe Aktion erneut ausführen Inkrementeller Scan: neue, geänderte und entfernte Dateien nach Änderungszeit und Größe @@ -539,8 +537,6 @@ Maximale lange Kante, mit der Frames für die Tiefenanalyse dekodiert werden (halbe native Größe, höchstens dieser Wert); größere Werte sind langsamer und erfassen feinere Details Freier Speicherplatz auf dem Archivlaufwerk Stammordner des lokalen Archivs; Dateien werden nicht verschoben · Enter übernimmt, Esc macht rückgängig - Index in den Sicherungsordner kopieren; die neuesten drei werden behalten · wenige Sekunden - Tägliche Kopien des Index (die neuesten drei werden behalten); wählen Sie die aus, zu der Sie zurückkehren möchten Archivordner auswählen Cache-Ordner auswählen; eine schnelle SSD hilft Hier werden ausgelagerte Frames und Miniaturansichten abgelegt; eine schnelle SSD hilft · Enter übernimmt, Esc macht rückgängig diff --git a/i18n/el/Tooltips.el.resx b/i18n/el/Tooltips.el.resx index 55db99ad..9af1eaab 100644 --- a/i18n/el/Tooltips.el.resx +++ b/i18n/el/Tooltips.el.resx @@ -21,7 +21,6 @@ Ο φάκελος της αρχειοθήκης δεν είναι προσβάσιμος. Το ευρετήριο μένει όπως ήταν την τελευταία φορά Ο φάκελος της αρχειοθήκης είναι προσβάσιμος και εγγράψιμος Αναγνώσιμος αλλά όχι εγγράψιμος: μόνο περιήγηση - Εγγραφή ενός συνεπούς αντιγράφου της βάσης δεδομένων του ευρετηρίου στον φάκελο αντιγράφων ασφαλείας. Διατηρούνται τα τρία τελευταία Φωτογραφίες ανά κάμερα. Οι μικρότερες ομαδοποιούνται Διακοπή της αναζήτησης. Δεν έχει αλλάξει τίποτα Εμφάνιση ξανά όλων των ακολουθιών της επιλογής @@ -72,7 +71,6 @@ Προσθήκη της αναδόμησης στην ουρά · η αρχειοθήκη παραμένει διαθέσιμη στο μεταξύ Επιλογή του νέου φακέλου μιας αρχειοθήκης που μετακινήσατε. Οι ακολουθίες της ενημερώνονται αναλόγως Εφαρμογή ακριβώς αυτών των αλλαγών σε φακέλους, αρχεία sidecar και ευρετήριο · συνεχίζει μετά από κατάρρευση - Επιλογή ημερήσιου αντιγράφου ασφαλείας του ευρετηρίου στις Ρυθμίσεις › Για προχωρημένους. Αντικαθιστά το ευρετήριο στην επόμενη εκκίνηση Αλλαγή των ετικετών αυτών των ακολουθιών στα αρχεία sidecar και στο ευρετήριο Νέα εκτέλεση της ίδιας ενέργειας Σταδιακή σάρωση: νέα, τροποποιημένα και διαγραμμένα αρχεία βάσει ώρας τροποποίησης και μεγέθους @@ -539,8 +537,6 @@ Η μέγιστη μεγάλη πλευρά στην οποία αποκωδικοποιούνται τα καρέ για την ανάλυση σε βάθος (το μισό του εγγενούς μεγέθους, έως αυτήν την τιμή). Μεγαλύτερο πλάτος σημαίνει πιο αργή ανάλυση αλλά λεπτότερες λεπτομέρειες Ελεύθερος χώρος στη μονάδα δίσκου της αρχειοθήκης Ριζικός φάκελος της τοπικής αρχειοθήκης. Τα αρχεία δεν μετακινούνται · Enter για εφαρμογή, Esc για αναίρεση - Αντιγραφή του ευρετηρίου στον φάκελο αντιγράφων ασφαλείας. Διατηρούνται τα τρία πιο πρόσφατα · λίγα δευτερόλεπτα - Ημερήσια αντίγραφα του ευρετηρίου (διατηρούνται τα τρία πιο πρόσφατα). Επιλέξτε αυτό στο οποίο θέλετε να επιστρέψετε Επιλογή του φακέλου της αρχειοθήκης Επιλογή του φακέλου κρυφής μνήμης. Ένας γρήγορος SSD βοηθά Εκεί μεταφέρονται τα καρέ που δεν χωρούν στη μνήμη και φυλάσσονται οι μικρογραφίες. Ένας γρήγορος SSD βοηθά · Enter για εφαρμογή, Esc για αναίρεση diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx index b5a51a15..8d67e04a 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -21,7 +21,7 @@ The archive folder cannot be reached; the index stays as last seen The archive folder is reachable and writable Readable but not writable: browse only - Write a consistent copy of the index database to the backups folder; the last three are kept + Write a consistent copy of the index database to the backups folder, which keeps as many copies as the backup schedules in Jobs › Scheduled Photos per camera; the smallest are grouped Stop the search; nothing has changed Show every sequence of the selection again @@ -72,7 +72,7 @@ Queue the rebuild · the archive stays usable meanwhile Choose the new folder of an archive you moved; its sequences follow Make exactly these changes to folders, sidecars and index · resumes after a crash - Choose a daily backup of the index in Settings › Advanced; it replaces the index at the next start + Choose a backup of the index in Settings › Advanced; it replaces the index at the next start Change the tags of these sequences in sidecars and index Run the same action again Incremental scan: new, changed and removed files by modification time and size @@ -625,8 +625,8 @@ Largest long edge frames are decoded at for deep analysis (half the native size up to this); wider is slower and sees finer detail Free space on the archive drive Root of the local archive; files are not moved · Enter applies, Esc reverts - Copy the index to the backups folder; the newest three are kept · a few seconds - Daily copies of the index (the newest three are kept); choose the one to return to + Copy the index to the backups folder, which keeps as many copies as the backup schedules in Jobs › Scheduled · a few seconds + Copies of the index made by the backup schedules and Back up now; choose the one to return to Choose the archive folder Choose the cache folder; a fast SSD helps Where frames spill and thumbnails are kept; a fast SSD helps · Enter applies, Esc reverts diff --git a/i18n/es/Tooltips.es.resx b/i18n/es/Tooltips.es.resx index ce2ee4e9..a06d288b 100644 --- a/i18n/es/Tooltips.es.resx +++ b/i18n/es/Tooltips.es.resx @@ -21,7 +21,6 @@ No se puede acceder a la carpeta de la fototeca; el índice se queda como se vio por última vez Se puede acceder a la carpeta de la fototeca y escribir en ella Se puede leer pero no escribir: solo para explorar - Escribe una copia coherente de la base de datos del índice en la carpeta de copias de seguridad; se conservan las tres últimas Fotos por cámara; las que tienen menos se agrupan Detiene la búsqueda; no ha cambiado nada Vuelve a mostrar todas las secuencias de la selección @@ -72,7 +71,6 @@ Pone en cola la reconstrucción · mientras tanto la fototeca sigue disponible Elige la nueva carpeta de una fototeca que has movido; sus secuencias la siguen Aplica exactamente estos cambios en carpetas, archivos sidecar e índice · se reanuda tras un cierre inesperado - Elige una copia de seguridad diaria del índice en Configuración › Avanzado; sustituye al índice en el próximo inicio Cambia las etiquetas de estas secuencias en los archivos sidecar y en el índice Vuelve a ejecutar la misma acción Escaneo incremental: archivos nuevos, modificados y eliminados según la fecha de modificación y el tamaño @@ -539,8 +537,6 @@ Lado largo máximo al que se decodifican los fotogramas para el análisis profundo (la mitad del tamaño nativo hasta este valor); más ancho es más lento y capta detalles más finos Espacio libre en la unidad de la fototeca Raíz de la fototeca local; los archivos no se mueven · Enter aplica, Esc revierte - Copia el índice en la carpeta de copias de seguridad; se conservan las tres más recientes · unos segundos - Copias diarias del índice (se conservan las tres más recientes); elige a cuál volver Elige la carpeta de la fototeca Elige la carpeta de caché; un SSD rápido ayuda Dónde se vuelcan los fotogramas y se guardan las miniaturas; un SSD rápido ayuda · Enter aplica, Esc revierte diff --git a/i18n/et/Tooltips.et.resx b/i18n/et/Tooltips.et.resx index 846eae42..f851a6c1 100644 --- a/i18n/et/Tooltips.et.resx +++ b/i18n/et/Tooltips.et.resx @@ -21,7 +21,6 @@ Arhiivi kaust pole kättesaadav; indeks jääb viimati nähtud kujule Arhiivi kaust on kättesaadav ja kirjutatav Loetav, kuid mitte kirjutatav: ainult sirvimiseks - Kirjutage indeksi andmebaasist järjepidev koopia varukoopiate kausta; säilitatakse kolm viimast Fotod kaamerate kaupa; väikseimad on rühmitatud Lõpetage otsing; midagi pole muudetud Kuvage taas kõik valiku jadad @@ -72,7 +71,6 @@ Lisage taasloomine järjekorda · arhiiv jääb seni kasutatavaks Valige teisaldatud arhiivi uus kaust; selle jadad liiguvad kaasa Tehke kaustades, kaasfailides ja indeksis täpselt need muudatused · jätkub pärast krahhi - Valige indeksi igapäevane varukoopia jaotises Sätted › Täpsemalt; see asendab indeksi järgmisel käivitamisel Muutke nende jadade silte kaasfailides ja indeksis Käivitage sama toiming uuesti Inkrementaalne skannimine: uued, muudetud ja eemaldatud failid muutmisaja ja suuruse järgi @@ -539,8 +537,6 @@ Suurim pikema külje pikkus, millega kaadrid süvaanalüüsiks dekodeeritakse (pool algsest suurusest kuni selle piirini); suurem on aeglasem ja eristab peenemaid detaile Vaba ruum arhiivi draivil Kohaliku arhiivi juurkaust; faile ei teisaldata · Enter rakendab, Esc taastab - Kopeerige indeks varukoopiate kausta; säilitatakse kolm uusimat · mõni sekund - Indeksi igapäevased koopiad (säilitatakse kolm uusimat); valige see, mille juurde naasta Valige arhiivikaust Valige vahemälu kaust; kiire SSD on abiks Kuhu kaadrid mälust välja tõstetakse ja pisipilte hoitakse; kiire SSD on abiks · Enter rakendab, Esc taastab diff --git a/i18n/fi/Tooltips.fi.resx b/i18n/fi/Tooltips.fi.resx index 34d34667..9cc4f038 100644 --- a/i18n/fi/Tooltips.fi.resx +++ b/i18n/fi/Tooltips.fi.resx @@ -21,7 +21,6 @@ Arkistokansioon ei saada yhteyttä; indeksi säilyy sellaisena kuin se viimeksi nähtiin Arkistokansio on käytettävissä ja kirjoitettavissa Luettavissa mutta ei kirjoitettavissa: vain selaus - Kirjoita indeksitietokannasta eheä kopio varmuuskopiokansioon; kolme viimeisintä säilytetään Kuvat kameroittain; pienimmät ryhmitellään yhteen Pysäytä haku; mitään ei ole muutettu Näytä taas kaikki valinnan sarjat @@ -72,7 +71,6 @@ Lisää uudelleenluonti jonoon · arkisto pysyy sillä välin käytettävissä Valitse siirtämäsi arkiston uusi kansio; sen sarjat seuraavat mukana Tee täsmälleen nämä muutokset kansioihin, sivutiedostoihin ja indeksiin · jatkuu kaatumisen jälkeen - Valitse indeksin päivittäinen varmuuskopio kohdassa Asetukset › Lisäasetukset; se korvaa indeksin seuraavassa käynnistyksessä Muuta näiden sarjojen tunnisteet sivutiedostoissa ja indeksissä Suorita sama toiminto uudelleen Inkrementaalinen skannaus: uudet, muuttuneet ja poistetut tiedostot muokkausajan ja koon perusteella @@ -539,8 +537,6 @@ Suurin pitkän sivun mitta, jolla kuvat puretaan syväanalyysia varten (puolet alkuperäisestä koosta, enintään tämä); suurempi on hitaampi ja erottaa hienompia yksityiskohtia Vapaa tila arkiston asemalla Paikallisen arkiston juuri; tiedostoja ei siirretä · Enter ottaa käyttöön, Esc palauttaa - Kopioi indeksi varmuuskopiokansioon; kolme uusinta säilytetään · muutama sekunti - Indeksin päivittäiset kopiot (kolme uusinta säilytetään); valitse se, johon palataan Valitse arkistokansio Valitse välimuistikansio; nopea SSD auttaa Kansio, johon kuvat siirretään muistista ja jossa pikkukuvat säilytetään; nopea SSD auttaa · Enter ottaa käyttöön, Esc palauttaa diff --git a/i18n/fr/Tooltips.fr.resx b/i18n/fr/Tooltips.fr.resx index 2acfd43c..49e44a53 100644 --- a/i18n/fr/Tooltips.fr.resx +++ b/i18n/fr/Tooltips.fr.resx @@ -21,7 +21,6 @@ Le dossier de l'archive est inaccessible ; l'index reste tel qu'il a été vu en dernier Le dossier de l'archive est accessible en lecture et en écriture Accessible en lecture mais pas en écriture : consultation uniquement - Écrire une copie cohérente de la base de données de l'index dans le dossier des sauvegardes ; les trois dernières sont conservées Photos par appareil ; les moins représentés sont regroupés Arrêter la recherche ; rien n'a été modifié Afficher de nouveau toutes les séquences de la sélection @@ -72,7 +71,6 @@ Mettre la reconstruction en file d'attente · l'archive reste utilisable pendant ce temps Choisir le nouveau dossier d'une archive que vous avez déplacée ; ses séquences suivent Appliquer exactement ces modifications aux dossiers, aux fichiers annexes et à l'index · reprend après un plantage - Choisir une sauvegarde quotidienne de l'index dans Paramètres › Avancé ; elle remplace l'index au prochain démarrage Modifier les étiquettes de ces séquences dans les fichiers annexes et l'index Relancer la même action Scan incrémentiel : fichiers nouveaux, modifiés et supprimés d'après la date de modification et la taille @@ -539,8 +537,6 @@ Grand côté maximal auquel les images sont décodées pour l'analyse approfondie (la moitié de la taille native, jusqu'à cette valeur) ; une valeur plus élevée est plus lente mais révèle des détails plus fins Espace libre sur le lecteur de l'archive Racine de l'archive locale ; les fichiers ne sont pas déplacés · Enter pour appliquer, Esc pour rétablir - Copier l'index dans le dossier des sauvegardes ; les trois plus récentes sont conservées · quelques secondes - Copies quotidiennes de l'index (les trois plus récentes sont conservées) ; choisissez celle à laquelle revenir Choisir le dossier de l'archive Choisir le dossier du cache ; un SSD rapide est préférable Emplacement des images en débordement et des miniatures ; un SSD rapide est préférable · Enter pour appliquer, Esc pour rétablir diff --git a/i18n/he/Tooltips.he.resx b/i18n/he/Tooltips.he.resx index dfbe813e..2d76970f 100644 --- a/i18n/he/Tooltips.he.resx +++ b/i18n/he/Tooltips.he.resx @@ -21,7 +21,6 @@ אין גישה לתיקיית הארכיון; האינדקס נשאר כפי שנראה לאחרונה תיקיית הארכיון נגישה וניתנת לכתיבה התיקייה ניתנת לקריאה אך לא לכתיבה: עיון בלבד - כתיבת עותק עקבי של מסד הנתונים של האינדקס לתיקיית הגיבויים; שלושת האחרונים נשמרים תמונות לפי מצלמה; מצלמות עם מעט תמונות מקובצות יחד עצירת החיפוש; שום דבר לא השתנה הצגה מחדש של כל הרצפים בבחירה @@ -73,7 +72,6 @@ הוספת הבנייה מחדש לתור · אפשר להמשיך להשתמש בארכיון בינתיים בחירת התיקייה החדשה של ארכיון שהועבר; הרצפים שלו עוברים איתו ביצוע השינויים האלה בדיוק בתיקיות, בקבצים הנלווים ובאינדקס · ממשיך לאחר קריסה - בחירת גיבוי יומי של האינדקס ב"הגדרות › מתקדם"; הגיבוי מחליף את האינדקס בהפעלה הבאה שינוי התגיות של הרצפים האלה בקבצים הנלווים ובאינדקס הרצה חוזרת של אותה פעולה סריקה מצטברת: קבצים חדשים, שהשתנו ושהוסרו, לפי זמן השינוי והגודל @@ -557,8 +555,6 @@ הצד הארוך המרבי שבו פריימים מפוענחים לניתוח מעמיק (מחצית מהגודל המקורי, עד לערך הזה); רוחב גדול יותר איטי יותר ורואה פרטים עדינים יותר שטח פנוי בכונן הארכיון תיקיית השורש של הארכיון המקומי; הקבצים אינם מועברים · Enter מחיל, Esc מבטל - העתקת האינדקס לתיקיית הגיבויים; שלושת הגיבויים האחרונים נשמרים · כמה שניות - עותקים יומיים של האינדקס (שלושת האחרונים נשמרים); יש לבחור את העותק שאליו רוצים לחזור בחירת תיקיית הארכיון בחירת תיקיית המטמון; כונן SSD מהיר עוזר המקום שאליו נשפכים פריימים ושבו נשמרות תמונות ממוזערות; כונן SSD מהיר עוזר · Enter מחיל, Esc מבטל diff --git a/i18n/hi/Tooltips.hi.resx b/i18n/hi/Tooltips.hi.resx index 7b3657df..e509c892 100644 --- a/i18n/hi/Tooltips.hi.resx +++ b/i18n/hi/Tooltips.hi.resx @@ -21,7 +21,6 @@ संग्रह फ़ोल्डर तक पहुँचा नहीं जा सकता; इंडेक्स वैसा ही रहता है जैसा पिछली बार देखा गया था संग्रह फ़ोल्डर तक पहुँचा जा सकता है और उसमें लिखा जा सकता है पढ़ा जा सकता है पर लिखा नहीं जा सकता: केवल ब्राउज़ करें - इंडेक्स डेटाबेस की एक सुसंगत कॉपी बैकअप फ़ोल्डर में लिखें; अंतिम तीन रखी जाती हैं प्रति कैमरा फ़ोटो; सबसे कम फ़ोटो वाले कैमरे एक साथ समूहित किए जाते हैं खोज रोकें; कुछ भी नहीं बदला है चयन का हर सीक्वेंस फिर से दिखाएँ @@ -72,7 +71,6 @@ पुनर्निर्माण कतार में रखें · इस दौरान संग्रह उपयोग योग्य रहता है आपके द्वारा स्थानांतरित किए गए संग्रह का नया फ़ोल्डर चुनें; उसके सीक्वेंस साथ आ जाते हैं फ़ोल्डर, साइडकार फ़ाइलों और इंडेक्स में ठीक यही बदलाव करें · क्रैश के बाद फिर से शुरू होता है - सेटिंग्स › उन्नत में इंडेक्स का कोई दैनिक बैकअप चुनें; वह अगली बार शुरू होने पर इंडेक्स की जगह लेता है इन सीक्वेंस के टैग साइडकार फ़ाइलों और इंडेक्स में बदलें वही क्रिया फिर से चलाएँ इंक्रीमेंटल स्कैन: संशोधन समय और आकार के आधार पर नई, बदली और हटाई गई फ़ाइलें @@ -539,8 +537,6 @@ गहन विश्लेषण के लिए फ़्रेम जिस अधिकतम लंबे किनारे पर डिकोड होते हैं (इस सीमा तक मूल आकार का आधा); अधिक चौड़ाई धीमी है पर बारीक विवरण देखती है संग्रह ड्राइव पर खाली स्थान स्थानीय संग्रह का रूट; फ़ाइलें स्थानांतरित नहीं होतीं · Enter से लागू, Esc से पूर्ववत - इंडेक्स को बैकअप फ़ोल्डर में कॉपी करें; नवीनतम तीन रखे जाते हैं · कुछ सेकंड - इंडेक्स की दैनिक कॉपियाँ (नवीनतम तीन रखी जाती हैं); जिस पर लौटना है उसे चुनें संग्रह फ़ोल्डर चुनें कैश फ़ोल्डर चुनें; तेज़ SSD मदद करता है जहाँ फ़्रेम डिस्क पर उतारे जाते हैं और थंबनेल रखे जाते हैं; तेज़ SSD मदद करता है · Enter से लागू, Esc से पूर्ववत diff --git a/i18n/hr/Tooltips.hr.resx b/i18n/hr/Tooltips.hr.resx index 54548379..7ee03767 100644 --- a/i18n/hr/Tooltips.hr.resx +++ b/i18n/hr/Tooltips.hr.resx @@ -21,7 +21,6 @@ Mapa arhive nije dostupna; indeks ostaje kakav je bio pri posljednjem pristupu Mapa arhive dostupna je i omogućuje zapisivanje Može se čitati, ali ne i zapisivati: samo pregledavanje - Zapisuje dosljednu kopiju baze podataka indeksa u mapu sigurnosnih kopija; čuvaju se tri posljednje Fotografije po fotoaparatu; najmanji su grupirani Zaustavlja pretraživanje; ništa nije promijenjeno Ponovno prikazuje sve sekvence odabira @@ -73,7 +72,6 @@ Stavlja ponovnu izgradnju u red čekanja · arhiva se u međuvremenu može upotrebljavati Odabir nove mape premještene arhive; njezine sekvence je slijede Primjenjuje točno ove promjene na mape, prateće datoteke i indeks · nastavlja se nakon rušenja programa - U odjeljku Postavke › Napredno odaberite dnevnu sigurnosnu kopiju indeksa; ona zamjenjuje indeks pri sljedećem pokretanju Mijenja oznake ovih sekvenci u pratećim datotekama i indeksu Ponovno pokreće istu radnju Inkrementalno skeniranje: nove, promijenjene i uklonjene datoteke prema vremenu izmjene i veličini @@ -557,8 +555,6 @@ Najveća dulja stranica na kojoj se kadrovi dekodiraju za dubinsku analizu (pola izvorne veličine, najviše do ove vrijednosti); veća širina sporija je i otkriva sitnije detalje Slobodan prostor na pogonu arhive Korijen lokalne arhive; datoteke se ne premještaju · Enter primjenjuje, Esc vraća - Kopira indeks u mapu sigurnosnih kopija; čuvaju se tri najnovije · nekoliko sekundi - Dnevne kopije indeksa (čuvaju se tri najnovije); odaberite onu na koju se želite vratiti Odabir mape arhive Odabir mape predmemorije; brzi SSD pomaže Mjesto za odložene kadrove i minijature; brzi SSD pomaže · Enter primjenjuje, Esc vraća diff --git a/i18n/hu/Tooltips.hu.resx b/i18n/hu/Tooltips.hu.resx index 35b0caa2..0456a798 100644 --- a/i18n/hu/Tooltips.hu.resx +++ b/i18n/hu/Tooltips.hu.resx @@ -21,7 +21,6 @@ Az archívummappa nem érhető el; az index a legutóbb látott állapotot mutatja Az archívummappa elérhető és írható Olvasható, de nem írható: csak böngészhető - Konzisztens másolatot ír az indexadatbázisról a biztonsági mentések mappájába; a legutóbbi három marad meg Fotók fényképezőgépenként; a legkisebbek összevonva Leállítja a keresést; semmi sem változott Ismét a kijelölés összes sorozatát mutatja @@ -72,7 +71,6 @@ Várólistára teszi az újraépítést · közben az archívum használható marad Egy áthelyezett archívum új mappájának kiválasztása; a sorozatai is követik Pontosan ezeket a módosításokat hajtja végre a mappákon, a kísérőfájlokon és az indexen · összeomlás után folytatódik - Az index egyik napi biztonsági mentését a Beállítások › Speciális lapon választhatja ki; a következő indításkor ez váltja fel az indexet Módosítja ezen sorozatok címkéit a kísérőfájlokban és az indexben Újra lefuttatja ugyanazt a műveletet Növekményes átvizsgálás: új, módosult és eltávolított fájlok a módosítási idő és a méret alapján @@ -539,8 +537,6 @@ A részletes elemzéshez dekódolt képkockák hosszabbik oldalának felső határa (a natív méret fele, legfeljebb ennyi); a nagyobb érték lassabb, de finomabb részleteket lát Szabad terület az archívum meghajtóján A helyi archívum gyökérmappája; a fájlok nem mozdulnak · Enter: alkalmaz, Esc: visszavon - Az indexet a biztonsági mentések mappájába másolja; a legújabb három marad meg · néhány másodperc - Az index napi másolatai (a legújabb három marad meg); válassza ki, melyikhez tér vissza Az archívummappa kiválasztása A gyorsítótár mappájának kiválasztása; egy gyors SSD sokat segít Ide kerülnek a lemezre kiírt képkockák és a miniatűrök; egy gyors SSD sokat segít · Enter: alkalmaz, Esc: visszavon diff --git a/i18n/id/Tooltips.id.resx b/i18n/id/Tooltips.id.resx index a9ba9032..ea6c1cf3 100644 --- a/i18n/id/Tooltips.id.resx +++ b/i18n/id/Tooltips.id.resx @@ -21,7 +21,6 @@ Folder arsip tidak dapat dijangkau; indeks tetap seperti saat terakhir terlihat Folder arsip dapat dijangkau dan ditulis Dapat dibaca tetapi tidak dapat ditulis: hanya untuk menelusuri - Tulis salinan konsisten basis data indeks ke folder cadangan; tiga cadangan terakhir disimpan Foto per kamera; kamera dengan foto paling sedikit digabungkan Hentikan pencarian; tidak ada yang berubah Tampilkan lagi semua sekuens dalam pilihan @@ -72,7 +71,6 @@ Antrekan pembangunan ulang · arsip tetap dapat digunakan selama proses Pilih folder baru dari arsip yang Anda pindahkan; sekuensnya ikut berpindah Terapkan tepat perubahan ini pada folder, sidecar, dan indeks · dilanjutkan jika aplikasi berhenti mendadak - Pilih cadangan harian indeks di Pengaturan › Lanjutan; cadangan itu menggantikan indeks saat Chronos dimulai berikutnya Ubah tag sekuens ini di sidecar dan indeks Jalankan tindakan yang sama lagi Pemindaian inkremental: file baru, berubah, dan terhapus menurut waktu modifikasi dan ukuran @@ -539,8 +537,6 @@ 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 Ruang kosong di drive arsip Akar arsip lokal; file tidak dipindahkan · Enter menerapkan, Esc membatalkan - Salin indeks ke folder cadangan; tiga cadangan terbaru disimpan · beberapa detik - Salinan harian indeks (tiga yang terbaru disimpan); pilih salinan yang ingin dipulihkan Pilih folder arsip Pilih folder cache; SSD yang cepat akan membantu Tempat bingkai dilimpahkan dan gambar mini disimpan; SSD yang cepat akan membantu · Enter menerapkan, Esc membatalkan diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx index 2dead7a8..232c9bde 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -21,7 +21,7 @@ La cartella dell'archivio non è raggiungibile; l'indice resta com'era La cartella dell'archivio è raggiungibile e scrivibile Leggibile ma non scrivibile: solo consultazione - Scrive una copia coerente del database dell'indice nella cartella delle copie; si tengono le ultime tre + Scrive una copia coerente del database dell'indice nella cartella delle copie, che ne tiene quante le copie pianificate in Attività › Pianificate Foto per fotocamera; le minori sono raggruppate Interrompi la ricerca; nulla è stato modificato Mostra di nuovo tutte le sequenze della selezione @@ -72,7 +72,7 @@ Metti in coda la ricostruzione · l'archivio resta utilizzabile Scegli la nuova cartella di un archivio spostato; le sequenze lo seguono Applica esattamente queste modifiche a cartelle, sidecar e indice · riprende dopo un arresto - Scegli una copia giornaliera dell'indice in Impostazioni › Avanzate; sostituisce l'indice al prossimo avvio + Scegli una copia dell'indice in Impostazioni › Avanzate; sostituisce l'indice al prossimo avvio Cambia i tag di queste sequenze in sidecar e indice Esegui di nuovo la stessa azione Scansione incrementale: file nuovi, modificati e rimossi per data e dimensione @@ -623,8 +623,8 @@ Lato lungo massimo dei fotogrammi decodificati per l'analisi profonda (metà della dimensione nativa fino a questo); più largo è più lento e vede dettagli più fini Spazio libero sull'unità dell'archivio Radice dell'archivio locale; i file non vengono spostati · Invio applica, Esc annulla - Copia l'indice nella cartella dei backup; vengono conservate le tre copie più recenti · pochi secondi - Copie giornaliere dell'indice (si tengono le tre più recenti); scegli quella a cui tornare + Copia l'indice nella cartella dei backup, che ne tiene quante le copie pianificate in Attività › Pianificate · pochi secondi + Copie dell'indice fatte dalle copie pianificate e da Salva una copia; scegli quella a cui tornare Scegli la cartella dell'archivio Scegli la cartella della cache; un SSD veloce aiuta Dove vanno i fotogrammi temporanei e le miniature; un SSD veloce aiuta · Invio applica, Esc annulla diff --git a/i18n/ja/Tooltips.ja.resx b/i18n/ja/Tooltips.ja.resx index bcacdcb1..15eaf34a 100644 --- a/i18n/ja/Tooltips.ja.resx +++ b/i18n/ja/Tooltips.ja.resx @@ -21,7 +21,6 @@ アーカイブフォルダーにアクセスできません。インデックスは最後に確認した状態のままです。 アーカイブフォルダーにアクセスでき、書き込みも可能です。 読み取りはできますが、書き込みはできません。閲覧のみ可能です。 - インデックスデータベースの整合性のあるコピーをバックアップフォルダーに書き込みます。最新の 3 つが保持されます。 カメラ別の写真数です。少ないものはまとめて表示されます。 検索を停止します。何も変更されていません。 選択範囲のすべてのシーケンスを再び表示します。 @@ -72,7 +71,6 @@ 再構築をキューに追加します · その間もアーカイブは使用できます 移動したアーカイブの新しいフォルダーを選択します。シーケンスの場所も合わせて更新されます。 フォルダー、サイドカー、インデックスにこの変更内容をそのまま適用します · クラッシュ後も再開できます - 「設定 › 詳細設定」でインデックスの日次バックアップを選択します。次回の起動時にインデックスが置き換えられます。 これらのシーケンスのタグを、サイドカーとインデックスで変更します。 同じ操作をもう一度実行します。 増分スキャン: 更新日時とサイズから、新規、変更、削除されたファイルを検出します。 @@ -539,8 +537,6 @@ 詳細分析でフレームをデコードするときの長辺の最大値です (ネイティブサイズの半分、ただしこの値まで)。大きいほど時間がかかりますが、細かいディテールを捉えます。 アーカイブのドライブの空き容量 ローカルアーカイブのルートです。ファイルは移動されません · Enter で適用、Esc で元に戻す - インデックスを backups フォルダーにコピーします。最新の 3 つが保持されます · 数秒 - インデックスの日次コピーです (最新の 3 つを保持)。戻したいものを選択してください。 アーカイブフォルダーを選択します。 キャッシュフォルダーを選択します。高速な SSD がおすすめです。 フレームの一時退避先とサムネイルの保存先です。高速な SSD がおすすめです · Enter で適用、Esc で元に戻す diff --git a/i18n/ko/Tooltips.ko.resx b/i18n/ko/Tooltips.ko.resx index bd0bae9c..8ab69fb0 100644 --- a/i18n/ko/Tooltips.ko.resx +++ b/i18n/ko/Tooltips.ko.resx @@ -21,7 +21,6 @@ 아카이브 폴더에 연결할 수 없습니다. 인덱스는 마지막으로 확인한 상태로 유지됩니다. 아카이브 폴더에 연결할 수 있고 쓰기가 가능합니다. 읽을 수는 있지만 쓸 수는 없습니다. 찾아보기만 가능합니다. - 인덱스 데이터베이스의 일관된 복사본을 백업 폴더에 씁니다. 최근 3개가 보관됩니다. 카메라별 사진 수입니다. 사진이 적은 카메라는 묶어서 표시합니다. 검색을 중지합니다. 아무것도 변경되지 않았습니다. 작업 대상의 모든 시퀀스를 다시 표시합니다. @@ -72,7 +71,6 @@ 재구성을 대기열에 추가합니다 · 그동안에도 아카이브를 사용할 수 있음 이동한 아카이브의 새 폴더를 선택합니다. 해당 시퀀스도 새 위치로 연결됩니다. 폴더, 사이드카, 인덱스에 정확히 이 변경 내용을 적용합니다 · 중단되어도 이어서 진행 - ‘설정 › 고급’에서 인덱스의 일일 백업을 선택합니다. 다음에 시작할 때 이 백업이 인덱스를 대체합니다. 사이드카와 인덱스에서 이 시퀀스들의 태그를 변경합니다. 같은 동작을 다시 실행합니다. 증분 스캔: 수정 시각과 크기를 기준으로 새 파일, 변경된 파일, 제거된 파일을 찾습니다. @@ -539,8 +537,6 @@ 정밀 분석 시 프레임을 디코딩하는 최대 긴 변 크기입니다(원본 크기의 절반, 최대 이 값까지). 클수록 느리지만 더 세밀한 디테일까지 포착합니다. 아카이브 드라이브의 여유 공간 로컬 아카이브의 루트입니다. 파일은 이동되지 않습니다 · Enter로 적용, Esc로 되돌리기 - 인덱스를 백업 폴더에 복사합니다. 최신 백업 3개가 보관됩니다 · 몇 초 소요 - 인덱스의 일일 복사본입니다(최신 3개 보관). 되돌아갈 복사본을 선택합니다. 아카이브 폴더를 선택합니다. 캐시 폴더를 선택합니다. 빠른 SSD가 좋습니다. 프레임을 옮겨 두고 썸네일을 보관하는 위치입니다. 빠른 SSD가 좋습니다 · Enter로 적용, Esc로 되돌리기 diff --git a/i18n/lt/Tooltips.lt.resx b/i18n/lt/Tooltips.lt.resx index 354656cb..6005a928 100644 --- a/i18n/lt/Tooltips.lt.resx +++ b/i18n/lt/Tooltips.lt.resx @@ -21,7 +21,6 @@ Archyvo aplanko pasiekti nepavyksta; indeksas lieka toks, koks buvo paskutinį kartą Archyvo aplankas pasiekiamas ir jame galima rašyti Galima skaityti, bet ne rašyti: tik naršyti - Įrašyti nuoseklią indekso duomenų bazės kopiją į atsarginių kopijų aplanką; saugomos trys paskutinės Nuotraukos pagal fotoaparatą; mažiausi sugrupuoti kartu Sustabdyti paiešką; niekas nepakeista Vėl rodyti visas žymėjimo sekas @@ -73,7 +72,6 @@ Įtraukti perkūrimą į eilę · archyvu galima naudotis ir tuo metu Pasirinkti naują perkelto archyvo aplanką; jo sekos perkeliamos kartu Atlikti būtent šiuos aplankų, šalutinių failų ir indekso pakeitimus · po strigties tęsiama - Pasirinkite kasdienę indekso atsarginę kopiją skiltyje Parametrai › Išplėstiniai; ji pakeičia indeksą kitą kartą paleidus programą Pakeisti šių sekų žymes šalutiniuose failuose ir indekse Dar kartą atlikti tą patį veiksmą Papildomas nuskaitymas: nauji, pakeisti ir pašalinti failai pagal keitimo laiką ir dydį @@ -557,8 +555,6 @@ Didžiausias ilgosios kraštinės dydis, kuriuo kadrai iškoduojami išsamiai analizei (pusė originalaus dydžio, bet ne daugiau nei šis); kuo didesnis, tuo lėčiau, bet matomos smulkesnės detalės Laisva vieta archyvo diske Vietinio archyvo šaknis; failai neperkeliami · Enter – taikyti, Esc – atšaukti - Kopijuoti indeksą į atsarginių kopijų aplanką; saugomos trys naujausios · kelios sekundės - Kasdienės indekso kopijos (saugomos trys naujausios); pasirinkite, į kurią grįžti Pasirinkti archyvo aplanką Pasirinkti talpyklos aplanką; greitas SSD padeda Kur iškeliami kadrai ir saugomos miniatiūros; greitas SSD padeda · Enter – taikyti, Esc – atšaukti diff --git a/i18n/lv/Tooltips.lv.resx b/i18n/lv/Tooltips.lv.resx index 2bddecbc..fe8b4907 100644 --- a/i18n/lv/Tooltips.lv.resx +++ b/i18n/lv/Tooltips.lv.resx @@ -21,7 +21,6 @@ Arhīva mape nav sasniedzama; indekss paliek tāds, kāds tas bija pēdējo reizi Arhīva mape ir sasniedzama un rakstāma Lasāms, bet nav rakstāms: tikai pārlūkošana - Ierakstīt konsekventu indeksa datu bāzes kopiju dublējumu mapē; tiek glabātas pēdējās trīs Fotoattēli pa kamerām; mazākās ir sagrupētas Apturēt meklēšanu; nekas nav mainīts Atkal rādīt visas atlases secības @@ -73,7 +72,6 @@ Ievietot pārbūvi rindā · arhīvs tikmēr paliek lietojams Izvēlēties pārvietota arhīva jauno mapi; tā secības seko līdzi Veikt tieši šīs izmaiņas mapēs, blakusfailos un indeksā · pēc avārijas turpinās - Izvēlieties indeksa ikdienas dublējumu sadaļā Iestatījumi › Papildu; tas aizstāj indeksu nākamajā startēšanas reizē Mainīt šo secību atzīmes blakusfailos un indeksā Vēlreiz izpildīt to pašu darbību Inkrementāla skenēšana: jauni, mainīti un noņemti faili pēc modificēšanas laika un lieluma @@ -557,8 +555,6 @@ Garākās malas maksimālais izmērs, kādā kadri tiek dekodēti padziļinātajai analīzei (puse no sākotnējā izmēra, bet ne vairāk par šo); lielāks ir lēnāks un saskata smalkākas detaļas Brīvā vieta arhīva diskā Lokālā arhīva sakne; faili netiek pārvietoti · Enter piemēro, Esc atsauc - Kopēt indeksu dublējumu mapē; tiek saglabāti trīs jaunākie · dažas sekundes - Indeksa ikdienas kopijas (tiek glabātas trīs jaunākās); izvēlieties, uz kuru atgriezties Izvēlēties arhīva mapi Izvēlēties kešatmiņas mapi; ātrs SSD palīdz Kur no atmiņas tiek pārvietoti kadri un glabāti sīktēli; ātrs SSD palīdz · Enter piemēro, Esc atsauc diff --git a/i18n/ms/Tooltips.ms.resx b/i18n/ms/Tooltips.ms.resx index 4ac273a8..5380fb79 100644 --- a/i18n/ms/Tooltips.ms.resx +++ b/i18n/ms/Tooltips.ms.resx @@ -21,7 +21,6 @@ Folder arkib tidak dapat dicapai; indeks kekal seperti kali terakhir dilihat Folder arkib boleh dicapai dan boleh ditulis Boleh dibaca tetapi tidak boleh ditulis: semak imbas sahaja - Tulis salinan konsisten pangkalan data indeks ke folder sandaran; tiga sandaran terakhir dikekalkan Foto setiap kamera; yang paling sedikit dikumpulkan bersama Hentikan carian; tiada apa-apa yang berubah Tunjukkan semula setiap jujukan dalam pilihan @@ -72,7 +71,6 @@ Masukkan pembinaan semula ke baris gilir · arkib kekal boleh digunakan sementara itu Pilih folder baharu bagi arkib yang anda pindahkan; jujukannya turut dipaut semula Buat perubahan ini dengan tepat pada folder, fail sidecar dan indeks · disambung semula selepas ranap - Pilih sandaran harian indeks dalam Tetapan › Lanjutan; sandaran itu menggantikan indeks pada permulaan seterusnya Tukar teg jujukan ini dalam fail sidecar dan indeks Jalankan tindakan yang sama sekali lagi Imbasan tokokan: fail baharu, berubah dan dialih keluar mengikut masa pengubahsuaian dan saiz @@ -539,8 +537,6 @@ Sisi panjang terbesar bingkai yang dinyahkod untuk analisis mendalam (separuh saiz asli, sehingga nilai ini); lebih lebar lebih perlahan dan melihat butiran yang lebih halus Ruang kosong pada pemacu arkib Akar arkib setempat; fail tidak dipindahkan · Enter untuk menggunakan, Esc untuk membatalkan - Salin indeks ke folder sandaran; tiga yang terbaharu disimpan · beberapa saat - Salinan harian indeks (tiga yang terbaharu disimpan); pilih salinan yang hendak dipulihkan Pilih folder arkib Pilih folder cache; SSD yang pantas membantu Tempat bingkai dilimpahkan dan lakaran kecil disimpan; SSD yang pantas membantu · Enter untuk menggunakan, Esc untuk membatalkan diff --git a/i18n/nb/Tooltips.nb.resx b/i18n/nb/Tooltips.nb.resx index ea095b4a..f2632ab5 100644 --- a/i18n/nb/Tooltips.nb.resx +++ b/i18n/nb/Tooltips.nb.resx @@ -21,7 +21,6 @@ Arkivmappen kan ikke nås; indeksen forblir slik den sist ble sett Arkivmappen kan nås og er skrivbar Lesbar, men ikke skrivbar: bare visning - Skriv en konsistent kopi av indeksdatabasen til mappen for sikkerhetskopier; de tre siste beholdes Bilder per kamera; de minste grupperes Stopp søket; ingenting er endret Vis alle sekvensene i utvalget igjen @@ -72,7 +71,6 @@ Legg gjenoppbyggingen i kø · arkivet kan brukes i mellomtiden Velg den nye mappen til et arkiv du har flyttet; sekvensene følger med Gjør nøyaktig disse endringene i mapper, sidecar-filer og indeks · fortsetter etter et krasj - Velg en daglig sikkerhetskopi av indeksen under Innstillinger › Avansert; den erstatter indeksen ved neste oppstart Endre etikettene til disse sekvensene i sidecar-filer og indeks Kjør den samme handlingen på nytt Inkrementell skanning: nye, endrede og fjernede filer etter endringstidspunkt og størrelse @@ -539,8 +537,6 @@ Største lengde på langsiden når bilder dekodes for dybdeanalyse (halvparten av den opprinnelige størrelsen, men høyst denne); bredere er tregere og ser finere detaljer Ledig plass på arkivstasjonen Roten av det lokale arkivet; filer flyttes ikke · Enter tar i bruk, Esc angrer - Kopier indeksen til sikkerhetskopimappen; de tre nyeste beholdes · noen sekunder - Daglige kopier av indeksen (de tre nyeste beholdes); velg den du vil gå tilbake til Velg arkivmappen Velg hurtigbuffermappen; en rask SSD hjelper Mappen for bilder som flyttes ut av minnet, og for miniatyrbilder; en rask SSD hjelper · Enter tar i bruk, Esc angrer diff --git a/i18n/nl/Tooltips.nl.resx b/i18n/nl/Tooltips.nl.resx index 6a4249f2..7323907a 100644 --- a/i18n/nl/Tooltips.nl.resx +++ b/i18n/nl/Tooltips.nl.resx @@ -21,7 +21,6 @@ De archiefmap is niet bereikbaar; de index blijft zoals die het laatst werd gezien De archiefmap is bereikbaar en beschrijfbaar Leesbaar maar niet beschrijfbaar: alleen bladeren - Schrijf een consistente kopie van de indexdatabase naar de back-upmap; de laatste drie blijven bewaard Foto's per camera; de kleinste worden gegroepeerd Stop het zoeken; er is niets gewijzigd Toon weer alle reeksen van de selectie @@ -72,7 +71,6 @@ Zet het opnieuw opbouwen in de wachtrij · het archief blijft intussen bruikbaar Kies de nieuwe map van een archief dat je hebt verplaatst; de reeksen ervan volgen Voer precies deze wijzigingen door in mappen, sidecarbestanden en index · wordt na een crash hervat - Kies een dagelijkse back-up van de index in Instellingen › Geavanceerd; die vervangt de index bij de volgende start Wijzig de tags van deze reeksen in sidecarbestanden en index Voer dezelfde actie opnieuw uit Incrementele scan: nieuwe, gewijzigde en verwijderde bestanden op basis van wijzigingstijd en grootte @@ -539,8 +537,6 @@ Grootste lange zijde waarop frames voor de diepgaande analyse worden gedecodeerd (de helft van de oorspronkelijke grootte, tot deze waarde); breder is langzamer en ziet fijnere details Vrije ruimte op het archiefstation Hoofdmap van het lokale archief; bestanden worden niet verplaatst · Enter past toe, Esc maakt ongedaan - Kopieer de index naar de back-upmap; de drie nieuwste worden bewaard · enkele seconden - Dagelijkse back-ups van de index (de drie nieuwste worden bewaard); kies de back-up waarnaar je wilt teruggaan Kies de archiefmap Kies de cachemap; een snelle SSD helpt Waar frames tijdelijk worden weggeschreven en miniaturen worden bewaard; een snelle SSD helpt · Enter past toe, Esc maakt ongedaan diff --git a/i18n/pl/Tooltips.pl.resx b/i18n/pl/Tooltips.pl.resx index ecf24643..c3d24782 100644 --- a/i18n/pl/Tooltips.pl.resx +++ b/i18n/pl/Tooltips.pl.resx @@ -21,7 +21,6 @@ Folder archiwum jest niedostępny; indeks pozostaje w ostatnio znanym stanie Folder archiwum jest dostępny do odczytu i zapisu Dostępny do odczytu, ale nie do zapisu: tylko przeglądanie - Zapisz spójną kopię bazy danych indeksu w folderze kopii zapasowych; zachowywane są trzy ostatnie Zdjęcia według aparatu; najmniejsze grupy są łączone Zatrzymaj wyszukiwanie; nic nie zostało zmienione Ponownie pokaż wszystkie sekwencje z zaznaczenia @@ -74,7 +73,6 @@ Dodaj odbudowę do kolejki · archiwum pozostaje w tym czasie dostępne Wybierz nowy folder przeniesionego archiwum; ścieżki jego sekwencji zostaną zaktualizowane Wprowadź dokładnie te zmiany w folderach, plikach sidecar i indeksie · wznawia się po awarii - Wybierz dzienną kopię zapasową indeksu w sekcji Ustawienia › Zaawansowane; zastąpi ona indeks przy następnym uruchomieniu Zmień tagi tych sekwencji w plikach sidecar i indeksie Wykonaj tę samą akcję ponownie Skanowanie przyrostowe: nowe, zmienione i usunięte pliki według czasu modyfikacji i rozmiaru @@ -575,8 +573,6 @@ Największa długość dłuższej krawędzi, z jaką klatki są dekodowane do dogłębnej analizy (połowa rozmiaru natywnego, maksymalnie tyle); większa wartość działa wolniej, ale wychwytuje drobniejsze szczegóły Wolne miejsce na dysku archiwum Katalog główny archiwum lokalnego; pliki nie są przenoszone · Enter stosuje, Esc przywraca - Skopiuj indeks do folderu kopii zapasowych; zachowywane są trzy najnowsze · kilka sekund - Dzienne kopie indeksu (zachowywane są trzy najnowsze); wybierz tę, do której chcesz wrócić Wybierz folder archiwum Wybierz folder pamięci podręcznej; szybki dysk SSD przyspiesza pracę Miejsce, do którego trafiają klatki przeniesione z pamięci i miniatury; szybki dysk SSD przyspiesza pracę · Enter stosuje, Esc przywraca diff --git a/i18n/pt-BR/Tooltips.pt-BR.resx b/i18n/pt-BR/Tooltips.pt-BR.resx index 822c89f3..f872f4ca 100644 --- a/i18n/pt-BR/Tooltips.pt-BR.resx +++ b/i18n/pt-BR/Tooltips.pt-BR.resx @@ -21,7 +21,6 @@ A pasta do acervo não está acessível; o índice fica como foi visto pela última vez A pasta do acervo está acessível e gravável Legível, mas não gravável: só para navegar - Grava uma cópia consistente do banco de dados do índice na pasta de backups; os três últimos são mantidos Fotos por câmera; as menores são agrupadas Interrompe a pesquisa; nada foi alterado Mostra de novo todas as sequências da seleção @@ -72,7 +71,6 @@ Coloca a reconstrução na fila · o acervo continua utilizável enquanto isso Escolhe a nova pasta de um acervo que você moveu; as sequências dele acompanham Faz exatamente estas alterações em pastas, arquivos sidecar e índice · retoma após uma falha - Escolha um backup diário do índice em Configurações › Avançado; ele substitui o índice na próxima inicialização Altera as tags destas sequências nos arquivos sidecar e no índice Executa a mesma ação de novo Varredura incremental: arquivos novos, alterados e removidos, pela data de modificação e pelo tamanho @@ -539,8 +537,6 @@ Lado maior máximo em que os quadros são decodificados para a análise aprofundada (metade do tamanho nativo até este valor); maior é mais lento e capta detalhes mais finos Espaço livre na unidade do acervo Raiz do acervo local; os arquivos não são movidos · Enter aplica, Esc reverte - Copia o índice para a pasta de backups; os três mais recentes são mantidos · alguns segundos - Cópias diárias do índice (as três mais recentes são mantidas); escolha para qual voltar Escolhe a pasta do acervo Escolhe a pasta do cache; um SSD rápido ajuda Onde ficam os quadros que excedem a memória e as miniaturas; um SSD rápido ajuda · Enter aplica, Esc reverte diff --git a/i18n/pt-PT/Tooltips.pt-PT.resx b/i18n/pt-PT/Tooltips.pt-PT.resx index 30b1db81..4791065d 100644 --- a/i18n/pt-PT/Tooltips.pt-PT.resx +++ b/i18n/pt-PT/Tooltips.pt-PT.resx @@ -21,7 +21,6 @@ Não é possível aceder à pasta do arquivo; o índice fica como foi visto pela última vez A pasta do arquivo está acessível e tem permissão de escrita Pode ser lida, mas não escrita: apenas navegação - Escrever uma cópia consistente da base de dados do índice na pasta de cópias de segurança; são mantidas as três mais recentes Fotografias por câmara; as mais pequenas são agrupadas Parar a pesquisa; nada foi alterado Mostrar novamente todas as sequências da seleção @@ -72,7 +71,6 @@ Colocar a reconstrução em fila · entretanto, o arquivo continua utilizável Escolher a nova pasta de um arquivo que moveu; as respetivas sequências acompanham-no Fazer exatamente estas alterações nas pastas, nos sidecars e no índice · retoma após uma falha - Escolher uma cópia de segurança diária do índice em Definições › Avançado; substitui o índice no próximo arranque Alterar as etiquetas destas sequências nos sidecars e no índice Executar novamente a mesma ação Exame incremental: ficheiros novos, alterados e removidos, pela data de modificação e pelo tamanho @@ -539,8 +537,6 @@ Lado maior máximo com que os fotogramas são descodificados para a análise aprofundada (metade do tamanho nativo até este valor); maior é mais lento e capta detalhes mais finos Espaço livre na unidade do arquivo Raiz do arquivo local; os ficheiros não são movidos · Enter aplica, Esc reverte - Copiar o índice para a pasta de cópias de segurança; são mantidas as três mais recentes · alguns segundos - Cópias diárias do índice (são mantidas as três mais recentes); escolha aquela para a qual quer voltar Escolher a pasta do arquivo Escolher a pasta da cache; um SSD rápido ajuda Onde ficam os fotogramas que excedem a memória e as miniaturas; um SSD rápido ajuda · Enter aplica, Esc reverte diff --git a/i18n/ro/Tooltips.ro.resx b/i18n/ro/Tooltips.ro.resx index baf2c676..4e437aad 100644 --- a/i18n/ro/Tooltips.ro.resx +++ b/i18n/ro/Tooltips.ro.resx @@ -21,7 +21,6 @@ Folderul arhivei nu poate fi accesat; indexul rămâne așa cum a fost văzut ultima dată Folderul arhivei este accesibil și permite scrierea Poate fi citit, dar nu și scris: doar pentru răsfoire - Scrieți o copie coerentă a bazei de date a indexului în folderul de copii de rezervă; se păstrează ultimele trei Fotografii pe aparat foto; cele mai puțin numeroase sunt grupate Opriți căutarea; nu s-a modificat nimic Afișați din nou toate secvențele selecției @@ -73,7 +72,6 @@ Puneți în coadă reconstruirea · între timp arhiva rămâne utilizabilă Alegeți noul folder al unei arhive pe care ați mutat-o; secvențele ei o urmează Aplicați exact aceste modificări folderelor, fișierelor sidecar și indexului · se reia după un blocaj - Alegeți o copie de rezervă zilnică a indexului în Setări › Avansat; aceasta înlocuiește indexul la următoarea pornire Modificați etichetele acestor secvențe în fișierele sidecar și în index Rulați din nou aceeași acțiune Scanare incrementală: fișiere noi, modificate și eliminate, după data modificării și dimensiune @@ -557,8 +555,6 @@ Latura lungă maximă la care sunt decodate cadrele pentru analiza aprofundată (jumătate din dimensiunea nativă, până la această valoare); o lățime mai mare este mai lentă și surprinde detalii mai fine Spațiul liber pe unitatea arhivei Rădăcina arhivei locale; fișierele nu sunt mutate · Enter aplică, Esc anulează - Copiați indexul în folderul de copii de rezervă; se păstrează cele mai recente trei · câteva secunde - Copii zilnice ale indexului (se păstrează cele mai recente trei); alegeți-o pe cea la care doriți să reveniți Alegeți folderul arhivei Alegeți folderul cache; un SSD rapid ajută Locul în care cadrele sunt mutate din memorie și miniaturile sunt păstrate; un SSD rapid ajută · Enter aplică, Esc anulează diff --git a/i18n/ru/Tooltips.ru.resx b/i18n/ru/Tooltips.ru.resx index 02ac0317..90790aa1 100644 --- a/i18n/ru/Tooltips.ru.resx +++ b/i18n/ru/Tooltips.ru.resx @@ -21,7 +21,6 @@ Папка архива недоступна; в индексе сохраняется последнее известное состояние Папка архива доступна для чтения и записи Доступна для чтения, но не для записи: только просмотр - Записать согласованную копию базы данных индекса в папку резервных копий; хранятся три последние Фото по камерам; самые малочисленные объединены Остановить поиск; ничего не будет изменено Снова показать все серии выделения @@ -74,7 +73,6 @@ Поставить перестроение в очередь · архивом можно пользоваться и в это время Выбрать новую папку перемещённого архива; пути его серий обновятся Внести именно эти изменения в папки, sidecar-файлы и индекс · после сбоя работа продолжится - Выбрать ежедневную резервную копию индекса в разделе «Параметры › Дополнительно»; она заменит индекс при следующем запуске Изменить теги этих серий в sidecar-файлах и индексе Выполнить то же действие ещё раз Инкрементное сканирование: новые, изменённые и удалённые файлы по времени изменения и размеру @@ -575,8 +573,6 @@ Наибольшая длинная сторона, до которой декодируются кадры для глубокого анализа (половина исходного размера, но не больше этого значения); чем больше, тем медленнее анализ и тем мельче различимые детали Свободное место на диске архива Корневая папка локального архива; файлы не перемещаются · Enter — применить, Esc — отменить - Скопировать индекс в папку резервных копий; хранятся три последние · несколько секунд - Ежедневные копии индекса (хранятся три последние); выберите ту, к которой нужно вернуться Выбрать папку архива Выбрать папку кэша; быстрый SSD ускоряет работу Куда выгружаются кадры и где хранятся эскизы; быстрый SSD ускоряет работу · Enter — применить, Esc — отменить diff --git a/i18n/sk/Tooltips.sk.resx b/i18n/sk/Tooltips.sk.resx index 16cf352b..2d0d4b17 100644 --- a/i18n/sk/Tooltips.sk.resx +++ b/i18n/sk/Tooltips.sk.resx @@ -21,7 +21,6 @@ Priečinok archívu nie je dostupný; index zostáva taký, aký bol naposledy Priečinok archívu je dostupný a zapisovateľný Dá sa čítať, ale nedá sa doň zapisovať: iba prehliadanie - Zapíše konzistentnú kópiu databázy indexu do priečinka záloh; ponechajú sa posledné tri Fotografie podľa fotoaparátu; najmenšie skupiny sa zlúčia Zastaví hľadanie; nič sa nezmenilo Znova zobrazí všetky sekvencie výberu @@ -73,7 +72,6 @@ Zaradí zostavenie indexu do frontu · archív sa medzitým dá používať Vyberie nový priečinok presunutého archívu; jeho sekvencie sa prepoja spolu s ním Vykoná presne tieto zmeny v priečinkoch, súboroch sidecar a indexe · po páde pokračuje - Dennú zálohu indexu vyberiete v časti Nastavenia › Rozšírené; pri ďalšom spustení nahradí index Zmení značky týchto sekvencií v súboroch sidecar a v indexe Znova spustí rovnakú akciu Prírastkové skenovanie: nové, zmenené a odstránené súbory podľa času úpravy a veľkosti @@ -557,8 +555,6 @@ Najväčšia dlhšia strana, na ktorú sa snímky dekódujú pri hĺbkovej analýze (polovica natívnej veľkosti, najviac táto hodnota); väčšia šírka je pomalšia a zachytí jemnejšie detaily Voľné miesto na jednotke archívu Koreňový priečinok lokálneho archívu; súbory sa nepresúvajú · Enter použije, Esc vráti späť - Skopíruje index do priečinka záloh; ponechajú sa tri najnovšie · niekoľko sekúnd - Denné kópie indexu (ponechávajú sa tri najnovšie); vyberte tú, ku ktorej sa chcete vrátiť Otvorí výber priečinka archívu Otvorí výber priečinka vyrovnávacej pamäte; pomôže rýchly disk SSD Kam sa odkladajú snímky a kde sa uchovávajú miniatúry; pomôže rýchly disk SSD · Enter použije, Esc vráti späť diff --git a/i18n/sl/Tooltips.sl.resx b/i18n/sl/Tooltips.sl.resx index 8f9c35f2..419c9731 100644 --- a/i18n/sl/Tooltips.sl.resx +++ b/i18n/sl/Tooltips.sl.resx @@ -21,7 +21,6 @@ Mapa arhiva ni dosegljiva; indeks ostane tak, kot je bil nazadnje viden Mapa arhiva je dosegljiva in zapisljiva Berljivo, a ne zapisljivo: samo brskanje - Zapiši dosledno kopijo zbirke podatkov indeksa v mapo z varnostnimi kopijami; hranijo se tri najnovejše Fotografije po fotoaparatih; najmanjši so združeni Ustavi iskanje; nič se ni spremenilo Znova pokaži vse sekvence izbora @@ -73,7 +72,6 @@ Dodaj ponovno izgradnjo v čakalno vrsto · arhiv ostane medtem uporaben Izberi novo mapo arhiva, ki ste ga premaknili; njegove sekvence mu sledijo Izvedi natanko te spremembe v mapah, datotekah sidecar in indeksu · po zrušitvi se nadaljuje - Izberi dnevno varnostno kopijo indeksa v razdelku Nastavitve › Dodatno; ob naslednjem zagonu zamenja indeks Spremeni oznake teh sekvenc v datotekah sidecar in indeksu Znova zaženi isto dejanje Inkrementalni pregled: nove, spremenjene in odstranjene datoteke po času spremembe in velikosti @@ -557,8 +555,6 @@ Največja daljša stranica, na katero se sličice dekodirajo za poglobljeno analizo (polovica izvorne velikosti, največ ta vrednost); večja širina je počasnejša in zazna drobnejše podrobnosti Prosti prostor na pogonu arhiva Koren lokalnega arhiva; datoteke se ne premaknejo · Enter uveljavi, Esc razveljavi - Kopiraj indeks v mapo z varnostnimi kopijami; hranijo se tri najnovejše · nekaj sekund - Dnevne kopije indeksa (hranijo se tri najnovejše); izberite tisto, na katero se želite vrniti Izberi mapo arhiva Izberi mapo predpomnilnika; hiter SSD pomaga Kam se odlagajo sličice in hranijo miniature; hiter SSD pomaga · Enter uveljavi, Esc razveljavi diff --git a/i18n/sv/Tooltips.sv.resx b/i18n/sv/Tooltips.sv.resx index 3f8c3287..0c9a2979 100644 --- a/i18n/sv/Tooltips.sv.resx +++ b/i18n/sv/Tooltips.sv.resx @@ -21,7 +21,6 @@ Arkivmappen går inte att nå; indexet behåller det senast kända läget Arkivmappen går att nå och skriva till Läsbar men inte skrivbar: endast bläddring - Skriv en konsekvent kopia av indexdatabasen till mappen för säkerhetskopior; de tre senaste sparas Foton per kamera; de minsta grupperas ihop Stoppa sökningen; inget har ändrats Visa alla sekvenser i markeringen igen @@ -72,7 +71,6 @@ Lägg återskapandet i kö · arkivet kan användas under tiden Välj den nya mappen för ett arkiv du har flyttat; dess sekvenser följer med Gör exakt de här ändringarna i mappar, sidecar-filer och index · återupptas efter en krasch - Välj en daglig säkerhetskopia av indexet under Inställningar › Avancerat; den ersätter indexet vid nästa start Ändra taggarna för de här sekvenserna i sidecar-filer och index Kör samma åtgärd igen Inkrementell genomsökning: nya, ändrade och borttagna filer efter ändringstid och storlek @@ -539,8 +537,6 @@ Största långsida som bildrutor avkodas med för djupanalys (halva originalstorleken, upp till detta värde); bredare är långsammare och fångar finare detaljer Ledigt utrymme på arkivenheten Rot för det lokala arkivet; filer flyttas inte · Enter tillämpar, Esc återställer - Kopiera indexet till mappen för säkerhetskopior; de tre senaste sparas · några sekunder - Dagliga kopior av indexet (de tre senaste sparas); välj den du vill återgå till Välj arkivmappen Välj cachemappen; en snabb SSD hjälper Där bildrutor flyttas ut till disk och miniatyrer sparas; en snabb SSD hjälper · Enter tillämpar, Esc återställer diff --git a/i18n/th/Tooltips.th.resx b/i18n/th/Tooltips.th.resx index a2589333..d1ff48dc 100644 --- a/i18n/th/Tooltips.th.resx +++ b/i18n/th/Tooltips.th.resx @@ -21,7 +21,6 @@ เข้าถึงโฟลเดอร์คลังภาพไม่ได้ ดัชนีจะคงไว้ตามที่เห็นครั้งล่าสุด เข้าถึงและเขียนโฟลเดอร์คลังภาพได้ อ่านได้แต่เขียนไม่ได้: เรียกดูได้เท่านั้น - เขียนสำเนาที่สอดคล้องกันของฐานข้อมูลดัชนีไปยังโฟลเดอร์สำรองข้อมูล โดยเก็บไว้สามชุดล่าสุด จำนวนภาพต่อกล้อง กล้องที่มีภาพน้อยที่สุดจะถูกรวมกลุ่มไว้ หยุดการค้นหา ยังไม่มีการเปลี่ยนแปลงใดๆ แสดงทุกซีเควนซ์ในส่วนที่เลือกอีกครั้ง @@ -72,7 +71,6 @@ เพิ่มการสร้างใหม่ลงคิว · ระหว่างนี้ยังใช้คลังภาพได้ตามปกติ เลือกโฟลเดอร์ใหม่ของคลังภาพที่คุณย้ายไป ซีเควนซ์ทั้งหมดจะย้ายตาม ทำการเปลี่ยนแปลงตามนี้ทุกประการกับโฟลเดอร์ ไฟล์ไซด์คาร์ และดัชนี · ทำต่อได้หลังเกิดการขัดข้อง - เลือกข้อมูลสำรองรายวันของดัชนีใน “การตั้งค่า › ขั้นสูง” ข้อมูลสำรองนั้นจะแทนที่ดัชนีเมื่อเริ่มโปรแกรมครั้งถัดไป เปลี่ยนแท็กของซีเควนซ์เหล่านี้ในไฟล์ไซด์คาร์และดัชนี เรียกใช้การดำเนินการเดิมอีกครั้ง การสแกนส่วนเพิ่ม: ไฟล์ใหม่ ไฟล์ที่เปลี่ยนแปลง และไฟล์ที่ถูกเอาออก ตามเวลาแก้ไขและขนาด @@ -539,8 +537,6 @@ ด้านยาวสูงสุดที่ใช้ถอดรหัสเฟรมสำหรับการวิเคราะห์เชิงลึก (ครึ่งหนึ่งของขนาดจริงแต่ไม่เกินค่านี้) ยิ่งกว้างยิ่งช้าแต่เห็นรายละเอียดได้ละเอียดขึ้น พื้นที่ว่างบนไดรฟ์ของคลังภาพ รากของคลังภาพในเครื่อง ไฟล์จะไม่ถูกย้าย · Enter เพื่อใช้ Esc เพื่อย้อนกลับ - คัดลอกดัชนีไปยังโฟลเดอร์สำรองข้อมูล โดยเก็บไว้สามชุดล่าสุด · ใช้เวลาไม่กี่วินาที - สำเนารายวันของดัชนี (เก็บไว้สามชุดล่าสุด) เลือกชุดที่ต้องการย้อนกลับไป เลือกโฟลเดอร์คลังภาพ เลือกโฟลเดอร์แคช SSD ที่เร็วจะช่วยได้ ตำแหน่งที่เฟรมล้นออกมาและเก็บภาพขนาดย่อ SSD ที่เร็วจะช่วยได้ · Enter เพื่อใช้ Esc เพื่อย้อนกลับ diff --git a/i18n/tr/Tooltips.tr.resx b/i18n/tr/Tooltips.tr.resx index df231198..2a67ef19 100644 --- a/i18n/tr/Tooltips.tr.resx +++ b/i18n/tr/Tooltips.tr.resx @@ -21,7 +21,6 @@ Arşiv klasörüne ulaşılamıyor; dizin son görüldüğü haliyle kalır Arşiv klasörüne ulaşılabiliyor ve klasör yazılabilir Okunabilir ama yazılamaz: yalnızca göz atılabilir - Dizin veritabanının tutarlı bir kopyasını yedekler klasörüne yazar; son üç yedek saklanır Kamera başına fotoğraf; en küçükler gruplanır Aramayı durdurur; hiçbir şey değişmez Seçimdeki tüm sekansları yeniden gösterir @@ -72,7 +71,6 @@ Yeniden oluşturmayı kuyruğa alır · bu sırada arşiv kullanılabilir kalır Taşıdığınız bir arşivin yeni klasörünü seçer; sekansları da onu izler Klasörlerde, sidecar dosyalarında ve dizinde tam olarak bu değişiklikleri yapar · çökmeden sonra kaldığı yerden sürer - Ayarlar › Gelişmiş bölümünden dizinin günlük bir yedeğini seçin; yedek, bir sonraki başlangıçta dizinin yerini alır Bu sekansların etiketlerini sidecar dosyalarında ve dizinde değiştirir Aynı eylemi yeniden çalıştırır Artımlı tarama: yeni, değişmiş ve kaldırılmış dosyaları değiştirilme zamanına ve boyuta göre bulur @@ -539,8 +537,6 @@ Ayrıntılı analiz için karelerin kodunun çözüldüğü en büyük uzun kenar (yerel boyutun yarısı, en fazla bu değer); daha geniş değer daha yavaştır ama daha ince ayrıntıları görür Arşiv sürücüsündeki boş alan Yerel arşivin kök klasörü; dosyalar taşınmaz · Enter uygular, Esc geri alır - Dizini yedekler klasörüne kopyalar; en yeni üç yedek saklanır · birkaç saniye - Dizinin günlük kopyaları (en yeni üçü saklanır); dönmek istediğiniz kopyayı seçin Arşiv klasörünü seçer Önbellek klasörünü seçer; hızlı bir SSD işe yarar Belleğe sığmayan karelerin ve küçük resimlerin tutulduğu yer; hızlı bir SSD işe yarar · Enter uygular, Esc geri alır diff --git a/i18n/uk/Tooltips.uk.resx b/i18n/uk/Tooltips.uk.resx index 644af630..7331c24d 100644 --- a/i18n/uk/Tooltips.uk.resx +++ b/i18n/uk/Tooltips.uk.resx @@ -21,7 +21,6 @@ Папка архіву недоступна; індекс зберігає стан, який було видно востаннє Папка архіву доступна для читання й запису Доступна для читання, але не для запису: лише перегляд - Записати узгоджену копію бази даних індексу в папку резервних копій; зберігаються три останні Фото за камерами; найменші групи об’єднано Зупинити пошук; нічого не змінено Знову показати всі послідовності вибору @@ -74,7 +73,6 @@ Поставити перебудову в чергу · тим часом архівом можна користуватися Вибрати нову папку архіву, який ви перемістили; його послідовності переходять разом із ним Внести саме ці зміни в папки, супровідні файли та індекс · продовжується після збою - Виберіть щоденну резервну копію індексу в розділі «Налаштування › Додатково»; вона замінить індекс під час наступного запуску Змінити теги цих послідовностей у супровідних файлах та індексі Ще раз виконати ту саму дію Інкрементне сканування: нові, змінені й вилучені файли за часом зміни та розміром @@ -575,8 +573,6 @@ Найбільша довша сторона, з якою декодуються кадри для глибокого аналізу (половина оригінального розміру, але не більше за це значення); більше значення працює повільніше, зате помічає дрібніші деталі Вільне місце на диску архіву Корінь локального архіву; файли не переміщуються · Enter застосовує, Esc скасовує - Скопіювати індекс до папки резервних копій; зберігаються три найновіші · кілька секунд - Щоденні копії індексу (зберігаються три найновіші); виберіть ту, до якої треба повернутися Вибрати папку архіву Вибрати папку кешу; бажано на швидкому SSD Куди скидаються кадри й де зберігаються мініатюри; бажано на швидкому SSD · Enter застосовує, Esc скасовує diff --git a/i18n/vi/Tooltips.vi.resx b/i18n/vi/Tooltips.vi.resx index cd7e62f5..7d710e08 100644 --- a/i18n/vi/Tooltips.vi.resx +++ b/i18n/vi/Tooltips.vi.resx @@ -21,7 +21,6 @@ Không thể truy cập thư mục kho lưu trữ; chỉ mục giữ nguyên như lần truy cập gần nhất Thư mục kho lưu trữ có thể truy cập và cho phép ghi Đọc được nhưng không ghi được: chỉ duyệt xem - Ghi một bản sao nhất quán của cơ sở dữ liệu chỉ mục vào thư mục sao lưu; giữ lại ba bản gần nhất Ảnh theo máy ảnh; các máy ít ảnh nhất được gộp lại Dừng tìm kiếm; không có gì thay đổi Hiển thị lại mọi chuỗi ảnh của vùng chọn @@ -72,7 +71,6 @@ Đưa việc dựng lại vào hàng đợi · kho lưu trữ vẫn dùng được trong lúc đó Chọn thư mục mới của kho lưu trữ bạn đã di chuyển; các chuỗi ảnh của nó sẽ đi theo Thực hiện đúng các thay đổi này với thư mục, sidecar và chỉ mục · tiếp tục được sau sự cố - Chọn một bản sao lưu hằng ngày của chỉ mục trong Cài đặt › Nâng cao; bản đó sẽ thay thế chỉ mục ở lần khởi động tiếp theo Thay đổi nhãn của các chuỗi ảnh này trong sidecar và chỉ mục Chạy lại cùng thao tác đó Quét tăng dần: tệp mới, đã thay đổi và đã bị xóa theo thời gian sửa đổi và kích thước @@ -539,8 +537,6 @@ Cạnh dài lớn nhất khi giải mã khung hình để phân tích sâu (một nửa kích thước gốc, tối đa đến giá trị này); rộng hơn thì chậm hơn nhưng thấy chi tiết mịn hơn Dung lượng trống trên ổ đĩa kho lưu trữ Thư mục gốc của kho lưu trữ cục bộ; tệp không bị di chuyển · Enter để áp dụng, Esc để hoàn tác - Sao chép chỉ mục vào thư mục sao lưu; giữ lại ba bản mới nhất · mất vài giây - Các bản sao hằng ngày của chỉ mục (giữ lại ba bản mới nhất); hãy chọn bản muốn quay về Chọn thư mục kho lưu trữ Chọn thư mục bộ nhớ đệm; nên dùng SSD nhanh Nơi chứa khung hình tràn ra và hình thu nhỏ; nên dùng SSD nhanh · Enter để áp dụng, Esc để hoàn tác diff --git a/i18n/zh-Hans/Tooltips.zh-Hans.resx b/i18n/zh-Hans/Tooltips.zh-Hans.resx index 95d3f24b..3a2cbf5b 100644 --- a/i18n/zh-Hans/Tooltips.zh-Hans.resx +++ b/i18n/zh-Hans/Tooltips.zh-Hans.resx @@ -21,7 +21,6 @@ 无法访问档案库文件夹;索引保留上次访问时的状态 档案库文件夹可访问且可写 可读但不可写:仅供浏览 - 将索引数据库的一致性副本写入备份文件夹;保留最近三份 每台相机的照片数;照片最少的相机合并显示 停止搜索;未做任何更改 重新显示所选内容中的所有序列 @@ -72,7 +71,6 @@ 将重建加入队列 · 期间档案库仍可使用 选择已移动档案库的新文件夹;其中的序列会随之更新 完全按列出的更改修改文件夹、附属文件和索引 · 崩溃后可继续 - 在“设置 › 高级”中选择索引的每日备份;它会在下次启动时替换索引 在附属文件和索引中更改这些序列的标签 再次运行相同的操作 增量扫描:按修改时间和大小查找新增、更改和删除的文件 @@ -539,8 +537,6 @@ 深度分析时解码帧所用的最大长边(原始尺寸的一半,最多到此值);越宽越慢,但能看到更精细的细节 档案库所在驱动器的可用空间 本地档案库的根文件夹;文件不会被移动 · Enter 应用,Esc 还原 - 将索引复制到备份文件夹;保留最新的三份 · 需要几秒钟 - 索引的每日副本(保留最新的三份);选择要恢复到的副本 选择档案库文件夹 选择缓存文件夹;使用快速的 SSD 效果更好 帧溢出和缩略图的存放位置;使用快速的 SSD 效果更好 · Enter 应用,Esc 还原 diff --git a/i18n/zh-Hant/Tooltips.zh-Hant.resx b/i18n/zh-Hant/Tooltips.zh-Hant.resx index 00636f0d..651d7c3d 100644 --- a/i18n/zh-Hant/Tooltips.zh-Hant.resx +++ b/i18n/zh-Hant/Tooltips.zh-Hant.resx @@ -21,7 +21,6 @@ 無法存取典藏庫資料夾;索引維持上次所見的狀態 典藏庫資料夾可存取且可寫入 可讀取但無法寫入:僅能瀏覽 - 將索引資料庫的一致性副本寫入備份資料夾;保留最近三份 各相機的相片數;數量最少的會合併為一組 停止搜尋;尚未做任何變更 再次顯示選取範圍中的所有序列 @@ -72,7 +71,6 @@ 將重建排入佇列 · 期間仍可使用典藏庫 選擇您移動後的典藏庫所在的新資料夾;其中的序列會隨之更新 完全依照上列內容變更資料夾、附屬檔與索引 · 當機後可繼續 - 在「設定 › 進階」中選擇索引的每日備份;該備份會在下次啟動時取代索引 在附屬檔與索引中變更這些序列的標籤 再次執行相同的動作 增量掃描:依修改時間與大小找出新增、變更與移除的檔案 @@ -539,8 +537,6 @@ 深度分析時解碼影格所用的最大長邊(原生尺寸的一半,最多到此值);越寬越慢,但能看到更細微的細節 典藏庫所在磁碟機的可用空間 本機典藏庫的根目錄;檔案不會被移動 · Enter 套用,Esc 還原 - 將索引複製到備份資料夾;保留最新的三份 · 需要幾秒鐘 - 索引的每日副本(保留最新的三份);選擇要恢復的那一份 選擇典藏庫資料夾 選擇快取資料夾;使用高速 SSD 會有幫助 溢出影格與縮圖的存放位置;使用高速 SSD 會有幫助 · Enter 套用,Esc 還原 diff --git a/src/Chronos.App/Jobs/DesktopScheduleHost.cs b/src/Chronos.App/Jobs/DesktopScheduleHost.cs index bd9a344e..b7eafeaf 100644 --- a/src/Chronos.App/Jobs/DesktopScheduleHost.cs +++ b/src/Chronos.App/Jobs/DesktopScheduleHost.cs @@ -29,8 +29,11 @@ public sealed class DesktopScheduleHost(AppSettings settings, FuncIncremental scan of the archive, every (10) minutes, no catch-up. public const string ArchiveScan = "archive-scan"; - /// Copy of the index into the backups folder, every day, with catch-up (it replaced the daily backup loop). - public const string IndexBackup = "index-backup"; + /// + /// Copy of the index into the backups folder, every day, with catch-up (it replaced the daily backup loop). Seeded due + /// at once when the newest copy is a day old, as that loop made one at start. + /// + public const string IndexBackup = DatabaseBackups.ScheduleKey; /// Clean-up of the job history and the cache, daily at 04:00, with catch-up. public const string Housekeeping = "housekeeping"; @@ -46,7 +49,8 @@ public sealed class DesktopScheduleHost(AppSettings settings, Func ShellActions.Reveal(path)); } diff --git a/src/Chronos.App/Sections/SettingsViewModel.cs b/src/Chronos.App/Sections/SettingsViewModel.cs index f7207c16..7a446600 100644 --- a/src/Chronos.App/Sections/SettingsViewModel.cs +++ b/src/Chronos.App/Sections/SettingsViewModel.cs @@ -30,7 +30,7 @@ namespace Chronos.App.Sections; /// Archive rows show and change the open archive's own settings (archive.json, through the archive engine) and are the /// defaults of new archives; Import and Analysis feed the defaults of new cards and the analysis jobs; Rendering feeds /// the jobs from the next one on; Formats lists the decode tier per format on this PC with the codec extensions to -/// install; Advanced sets the log files () and restores the index from a daily backup at the next start; +/// install; Advanced sets the log files () and restores the index from a backup at the next start; /// About, the last page, shows this copy (, whose update notice Updates shows). /// public sealed class SettingsViewModel : SectionViewModel @@ -762,7 +762,7 @@ public sealed class SettingsViewModel : SectionViewModel public ICommand ExportDiagnosticsCommand { get; } public ICommand BackupDatabaseCommand { get; } - /// The daily copies of the index, newest first (Restore). + /// The copies of the index in the backups folder, newest first (Restore). public IReadOnlyList Backups { get => _backups; @@ -1303,7 +1303,8 @@ public sealed class SettingsViewModel : SectionViewModel if (Shell.Services.Database is not { } db) return; try { - var path = await db.BackupAsync(Shell.Services.Environment.BackupDirectory, DatabaseBackups.Keep); + // As many copies stay as the backup schedules keep (Jobs › Scheduled › Index backup › Copies kept). + var path = await db.BackupAsync(Shell.Services.Environment.BackupDirectory, await DatabaseBackups.KeptAsync(db)); Shell.Notify(Loc.L("Settings.Advanced.BackupDone"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path)); } catch (Exception ex) when (ex is DatabaseException or IOException or NotSupportedException) @@ -1337,7 +1338,7 @@ public sealed class SettingsViewModel : SectionViewModel /// Restore (BRIEF §6.2, §12.8): a dry run reads what the chosen copy holds against the index now (shown as unreadable /// when the index did not open, the case a restore exists for); after the user's destructive confirmation the copy is /// staged beside the index for the next start, where the index as it is then is kept first and replaced before it is - /// opened (; the staged copy is out of reach of the pruning to three + /// opened (; the staged copy is out of reach of the pruning of the /// copies). Nothing replaces the index while Chronos runs. /// private async Task RestoreDatabaseAsync() diff --git a/src/Chronos.Core/Diagnostics/FileLogSink.cs b/src/Chronos.Core/Diagnostics/FileLogSink.cs index f18cddfe..cd8a5f43 100644 --- a/src/Chronos.Core/Diagnostics/FileLogSink.cs +++ b/src/Chronos.Core/Diagnostics/FileLogSink.cs @@ -52,7 +52,8 @@ public sealed record LogFileOptions /// a file that reaches continues in prefix-yyyyMMdd[-HH].1.log, .2… /// At every new file (and when the options change) files older than the retention are deleted, then the oldest while /// the sink's files exceed ; only names this sink writes are touched, never the -/// file being written. Lines are flushed one by one; applies new options from the next line. +/// file being written. Lines are flushed one by one; one that cannot be written (the folder removed, a full disk) is dropped +/// and the next opens the file again. applies new options from the next line. /// public sealed class FileLogSink : ILogSink, IDisposable { @@ -111,9 +112,18 @@ public sealed class FileLogSink : ILogSink, IDisposable { if (_disposed || level < _options.Level) return; var now = Now; - EnsureFile(now); - _writer!.WriteLine(string.Create(CultureInfo.InvariantCulture, $"{now:O} {level,-7} {category}: {message}")); - if (exception is not null) _writer.WriteLine(exception.ToString()); + try + { + EnsureFile(now); + _writer!.WriteLine(string.Create(CultureInfo.InvariantCulture, $"{now:O} {level,-7} {category}: {message}")); + if (exception is not null) _writer.WriteLine(exception.ToString()); + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + // The folder is gone, the disk is full or the file is locked: the line is dropped and the next one opens + // the file again. + Close(); + } } } @@ -182,9 +192,17 @@ public sealed class FileLogSink : ILogSink, IDisposable private void Close() { - _writer?.Dispose(); + var writer = _writer; _writer = null; _stream = null; + try + { + writer?.Dispose(); + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + // What it still held could not be flushed (a full disk); its file is closed all the same. + } } private string Stem(DateTime now) => _options.Rotation == LogRotation.Hourly diff --git a/src/Chronos.Core/Diagnostics/Log.cs b/src/Chronos.Core/Diagnostics/Log.cs index ed47d7a7..f4de2b4d 100644 --- a/src/Chronos.Core/Diagnostics/Log.cs +++ b/src/Chronos.Core/Diagnostics/Log.cs @@ -21,6 +21,8 @@ public interface ILogSink /// Tiny engine-wide logger. Core code logs through it; hosts plug in a sink. drops lines no sink /// wants before they are formatted: hosts set it to the lowest level of their sinks, which each keep their own (a /// its , the server's console and files their filters). +/// Logging never throws: a line a sink cannot write is dropped, so code that logs from its error handling (the job engine +/// marking a job failed, the scheduler's loop) always goes on to its next step. /// public static class Log { @@ -28,6 +30,9 @@ public static class Log public static LogLevel MinimumLevel { get; set; } = LogLevel.Info; + /// Where lines go now (a test that replaces it puts this one back). + public static ILogSink Sink => _sink; + public static void SetSink(ILogSink sink) => _sink = sink ?? throw new ArgumentNullException(nameof(sink)); public static void Debug(string category, string message) => Write(LogLevel.Debug, category, message, null); @@ -42,9 +47,11 @@ public static class Log { _sink.Write(level, category, message, exception); } - catch (IOException) + catch (Exception ex) when (ex is not OutOfMemoryException) { - // Logging must never take the process down. + // Logging must never take the process down, nor skip what its caller does next: a log folder removed, a full + // disk or the logger of a host already gone (Microsoft.Extensions.Logging wraps what its providers throw in an + // AggregateException) only lose the line. } } @@ -59,12 +66,22 @@ public static class Log } } -/// Writes every event to several sinks. +/// Writes every event to several sinks; one that cannot write it does not keep it from the others. public sealed class TeeLogSink(params ILogSink[] sinks) : ILogSink { public void Write(LogLevel level, string category, string message, Exception? exception) { - foreach (var sink in sinks) sink.Write(level, category, message, exception); + foreach (var sink in sinks) + { + try + { + sink.Write(level, category, message, exception); + } + catch (Exception ex) when (ex is not OutOfMemoryException) + { + // That sink loses the line (see Log.Write). + } + } } } diff --git a/src/Chronos.Data/Archiving/ArchiveService.cs b/src/Chronos.Data/Archiving/ArchiveService.cs index e35ff8e3..b58fb9e6 100644 --- a/src/Chronos.Data/Archiving/ArchiveService.cs +++ b/src/Chronos.Data/Archiving/ArchiveService.cs @@ -64,6 +64,9 @@ public sealed class ArchiveService : IJobHandlerProvider /// public IReadOnlyList CleanupSteps { get; } + /// Where this engine's jobs put their copies (; null: next to the index). + public string? BackupDirectory => _writer.Options.BackupDirectory; + /// /// Handlers for scan, rebuild, verify, import, thumbs, proxies and maintenance jobs, the read-only duplicates and orphans /// reports, index backups and clean-ups (owner review 2, R10); register them on the . diff --git a/src/Chronos.Data/DatabaseBackups.cs b/src/Chronos.Data/DatabaseBackups.cs index 91f50c34..c9a8f9c1 100644 --- a/src/Chronos.Data/DatabaseBackups.cs +++ b/src/Chronos.Data/DatabaseBackups.cs @@ -13,22 +13,21 @@ public sealed record DatabaseBackup(string Path, DateTimeOffset Created, long By public sealed record DatabaseSummary(int SchemaVersion, int Archives, int Sequences, long Photos); /// -/// Backups of the SQLite index (BRIEF §6.2): a VACUUM INTO copy made once a day while the host runs (at start -/// when the newest copy is a day old, then checked every hour), the three newest kept; and their restore from -/// Settings › Advanced. A restore never swaps the file under a running host: the chosen copy is staged next to the -/// index and replaces it at the next start, before the host opens the index (so it also recovers an index that no -/// longer opens), once the index it replaces has been kept. +/// Backups of the SQLite index (BRIEF §6.2): VACUUM INTO copies in the backups folder, made by the +/// jobs of the hosts' index-backup system schedule (owner review 2, R10: every +/// day on the desktop, at 03:00 on the server; its recurrence and Copies kept can be edited, three by default), by Back up +/// now, and of the index a restore replaces. Every copy keeps as many as the backup schedules keep +/// (). A restore, from Settings › Advanced, never swaps the file under a running host: the chosen +/// copy is staged next to the index and replaces it at the next start, before the host opens the index (so it also +/// recovers an index that no longer opens), once the index it replaces has been kept. /// public static partial class DatabaseBackups { - /// Copies kept (BRIEF §6.2: ×3). + /// Copies kept by default (BRIEF §6.2: ×3). public const int Keep = 3; - /// Age of the newest copy from which the next one is due. - public static readonly TimeSpan Interval = TimeSpan.FromDays(1); - - /// How often a running host checks whether a copy is due. - public static readonly TimeSpan CheckInterval = TimeSpan.FromHours(1); + /// The hosts' system schedule that makes the copies. + public const string ScheduleKey = "index-backup"; /// Name of the folder next to the index that holds its copies (the desktop's and the server's). public const string DirectoryName = "backups"; @@ -80,39 +79,47 @@ public static partial class DatabaseBackups return backups; } - /// True when there is no copy yet or the newest one is at least old. - public static bool IsDue(IReadOnlyList backups, DateTimeOffset now) => backups.Count == 0 || now - backups[0].Created >= Interval; - /// - /// Makes the daily copy of a SQLite index into until - /// is cancelled: now when one is due, then whenever an hourly check finds one due. A failed copy is logged and tried - /// again at the next check. Returns at once for PostgreSQL, which its own server tools back up. + /// When the newest copy of 's index file in (null: ) + /// was made; null when there is none, the index has no file, or the folder cannot be read. The hosts seed their index + /// backup schedule with it (), so the first copy after an upgrade comes + /// as the former daily loop would have made it. /// - public static async Task RunDailyAsync(ChronosDatabase db, string directory, TimeProvider? time = null, CancellationToken cancellationToken = default) + public static DateTimeOffset? Newest(ChronosDatabase db, string? directory) { - if (db.Database is not SqliteDatabase { Path: { } path }) return; - var clock = time ?? TimeProvider.System; - using var timer = new PeriodicTimer(CheckInterval, clock); + ArgumentNullException.ThrowIfNull(db); + if (db.Database is not SqliteDatabase { Path: { } path }) return null; try { - do - { - try - { - if (IsDue(List(directory, path), clock.GetUtcNow())) await db.BackupAsync(directory, Keep, cancellationToken).ConfigureAwait(false); - } - catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or DatabaseException) - { - Log.Warning("backup", $"The daily index backup into {directory} failed; it is tried again within the hour", ex); - } - } - while (await timer.WaitForNextTickAsync(cancellationToken).ConfigureAwait(false)); + return List(directory ?? DefaultDirectory(path), path) is [var newest, ..] ? newest.Created : null; } - catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) { + return null; } } + /// + /// How many copies the backups folder keeps: the largest Copies kept of the backup schedules, the + /// system schedule's among them, enabled or not ( with none). Every copy prunes to it, so Back up now, the + /// copy kept before a restore and a schedule that keeps fewer never delete copies another schedule keeps. + /// + public static async Task KeptAsync(ChronosDatabase db, CancellationToken cancellationToken = default) => + await ScheduledKeepAsync(db, cancellationToken).ConfigureAwait(false) is > 0 and var kept ? kept : Keep; + + /// The largest Copies kept of the backup schedules (1 to ); 0 without any. + internal static async Task ScheduledKeepAsync(ChronosDatabase db, CancellationToken cancellationToken) + { + ArgumentNullException.ThrowIfNull(db); + var kept = 0; + foreach (var schedule in await db.Schedules.ListAsync(cancellationToken).ConfigureAwait(false)) + { + if (schedule.Action == Scheduling.ScheduleActions.Backup && Scheduling.ScheduleMapping.Parameters(schedule).Keep is { } keep) + kept = int.Max(kept, int.Clamp(keep, 1, Housekeeping.BackupJobHandler.MaxKeep)); + } + return kept; + } + /// Counts what the index holds (the current one, for the restore's comparison). public static async Task SummarizeAsync(ChronosDatabase db, CancellationToken cancellationToken = default) { @@ -196,7 +203,7 @@ public static partial class DatabaseBackups /// Carries out a staged restore before the host opens the index at , so it also /// recovers an index that no longer opens. The staged copy is checked first (: /// quick_check, open, migration). The index as it is now is kept in : as a - /// fresh VACUUM INTO copy among the daily ones, or, when it cannot be read, copied there whole (with its WAL) as + /// fresh VACUUM INTO copy among the others, or, when it cannot be read, copied there whole (with its WAL) as /// <name>-replaced-<stamp>.db, outside the rotation, so it never pushes a good copy out. Only then is /// the staged copy renamed over the index: the rename consumes it, so it is never applied twice. The host's open then /// migrates it to this build's schema. False when none was staged. @@ -231,14 +238,16 @@ public static partial class DatabaseBackups /// /// The index about to be replaced, kept in : a VACUUM INTO copy when it opens, - /// else the file itself with its WAL, set aside under a name the pruning of the daily copies never matches. + /// pruning to what its backup schedules keep (), else the file itself with its WAL, set aside under + /// a name the pruning of the copies never matches. /// private static async Task KeepAsync(string path, string backupDirectory, CancellationToken cancellationToken) { try { await using var current = await ChronosDatabase.OpenAsync(DatabaseOptions.Sqlite(path), cancellationToken).ConfigureAwait(false); - return await current.BackupAsync(backupDirectory, Keep, cancellationToken).ConfigureAwait(false); + var keep = await KeptAsync(current, cancellationToken).ConfigureAwait(false); + return await current.BackupAsync(backupDirectory, keep, cancellationToken).ConfigureAwait(false); } catch (Exception ex) when (ex is DatabaseException or SchemaTooNewException) { diff --git a/src/Chronos.Data/Housekeeping/HousekeepingJobHandlers.cs b/src/Chronos.Data/Housekeeping/HousekeepingJobHandlers.cs index 38a3a187..0b675704 100644 --- a/src/Chronos.Data/Housekeeping/HousekeepingJobHandlers.cs +++ b/src/Chronos.Data/Housekeeping/HousekeepingJobHandlers.cs @@ -10,8 +10,9 @@ namespace Chronos.Data.Housekeeping; /// /// (owner review 2, R10): a VACUUM INTO copy of the SQLite index into /// (by default the backups folder next to the index, ), -/// keeping the newest . A PostgreSQL index, or one without a file, cannot be copied this -/// way (): the job fails with that reason, and schedules do not queue it. +/// keeping the newest , or more when a backup schedule keeps more (one folder, one +/// retention: ). A PostgreSQL index, or one without a file, cannot be +/// copied this way (): the job fails with that reason, and schedules do not queue it. /// internal sealed class BackupJobHandler(ChronosDatabase db, string? directory) : IJobHandler { @@ -26,7 +27,8 @@ internal sealed class BackupJobHandler(ChronosDatabase db, string? directory) : throw new NotSupportedException(DatabaseBackups.Unavailable(db) == Scheduling.ScheduleUnavailable.Postgres ? "Backups of a PostgreSQL database are made with the server's own tools." : "An index without a file cannot be backed up."); - var keep = Math.Clamp(ArchiveJobJson.Read(context.Job, ArchiveJobJson.Default.BackupParameters, new BackupParameters(DatabaseBackups.Keep)).Keep, 1, MaxKeep); + var own = Math.Clamp(ArchiveJobJson.Read(context.Job, ArchiveJobJson.Default.BackupParameters, new BackupParameters(DatabaseBackups.Keep)).Keep, 1, MaxKeep); + var keep = int.Max(own, await DatabaseBackups.ScheduledKeepAsync(db, context.Cancellation).ConfigureAwait(false)); await context.ReportAsync(0, 1).ConfigureAwait(false); var copy = await db.BackupAsync(directory ?? DatabaseBackups.DefaultDirectory(path), keep, context.Cancellation).ConfigureAwait(false); context.Log(Loc.L("Archive.Log.BackupDone", copy, CleanupSteps.Megabytes(new FileInfo(copy).Length), keep)); diff --git a/src/Chronos.Data/Repositories/ScheduleRepository.cs b/src/Chronos.Data/Repositories/ScheduleRepository.cs index aaf989b7..061bf2ea 100644 --- a/src/Chronos.Data/Repositories/ScheduleRepository.cs +++ b/src/Chronos.Data/Repositories/ScheduleRepository.cs @@ -65,13 +65,17 @@ public sealed class ScheduleRepository /// /// Inserts each system schedule whose key no row has yet (INSERT … ON CONFLICT (system_key) DO NOTHING), with - /// no next run (the scheduler computes it); rows that exist keep whatever the user changed. Rows added together are - /// stamped a microsecond apart, so listings keep the host's order. Returns how many were added. + /// no next run (the scheduler computes it), or due at when it is enabled and its work was last + /// done a period or more before (); rows that exist keep whatever the user changed. + /// Rows added together are stamped a microsecond apart, so listings keep the host's order. Returns how many were added. /// public Task EnsureSystemAsync(IEnumerable schedules, DateTimeOffset now, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(schedules); - var rows = schedules.Select((s, i) => FromSystem(s, now.AddTicks(i * TimeSpan.TicksPerMicrosecond))).ToList(); + var rows = schedules.Select((s, i) => FromSystem(s, now.AddTicks(i * TimeSpan.TicksPerMicrosecond)) with + { + NextRun = s.Enabled && s.LastDone is { } done && now - done >= s.Recurrence.Period ? now : null, + }).ToList(); return rows.Count == 0 ? Task.FromResult(0) : _db.InTransactionAsync(async session => { var added = 0; diff --git a/src/Chronos.Data/Scheduling/IScheduleHost.cs b/src/Chronos.Data/Scheduling/IScheduleHost.cs index a308af17..86668aeb 100644 --- a/src/Chronos.Data/Scheduling/IScheduleHost.cs +++ b/src/Chronos.Data/Scheduling/IScheduleHost.cs @@ -45,7 +45,10 @@ public interface IScheduleHost /// /// A host's system schedule: identifies it across starts (archive-scan, /// index-backup, housekeeping…); the rest is what it is seeded with and reset to. 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. 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. /// 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); diff --git a/src/Chronos.Server/Hosting/FileLoggerProvider.cs b/src/Chronos.Server/Hosting/FileLoggerProvider.cs index 752fa658..7ef57455 100644 --- a/src/Chronos.Server/Hosting/FileLoggerProvider.cs +++ b/src/Chronos.Server/Hosting/FileLoggerProvider.cs @@ -52,8 +52,16 @@ public sealed class LoggerSink(ILoggerFactory factory) : ILogSink CoreLogLevel.Warning => MsLogLevel.Warning, _ => MsLogLevel.Error, }; + try + { #pragma warning disable CA2254 // Engine messages are preformatted. - logger.Log(ms, exception, message); + logger.Log(ms, exception, message); #pragma warning restore CA2254 + } + catch (AggregateException) + { + // A provider could not write it (Microsoft.Extensions.Logging gathers what they throw): the line is dropped, as + // Log.Write would drop it, so the engine code that logs goes on. + } } } diff --git a/src/Chronos.Server/Jobs/ServerScheduleHost.cs b/src/Chronos.Server/Jobs/ServerScheduleHost.cs index 570203c5..8481defa 100644 --- a/src/Chronos.Server/Jobs/ServerScheduleHost.cs +++ b/src/Chronos.Server/Jobs/ServerScheduleHost.cs @@ -24,7 +24,7 @@ public sealed class ServerScheduleHost : IScheduleHost { public const string ArchiveScan = "archive-scan"; public const string UploadCleanup = "upload-cleanup"; - public const string IndexBackup = "index-backup"; + public const string IndexBackup = DatabaseBackups.ScheduleKey; public const string Housekeeping = "housekeeping"; public const string AuditCleanup = "audit-cleanup"; @@ -73,11 +73,12 @@ public sealed class ServerScheduleHost : IScheduleHost new(UploadCleanup, "Upload clean-up", ScheduleActions.Cleanup, ScheduleRecurrence.Interval(UploadSweepHours, RecurrenceUnit.Hours), new ScheduleParametersDto(OlderThanDays: UploadMaintenance.FinishedRetentionDays, Steps: [UploadCleanupStep.StepName])), }; - // PostgreSQL is backed up with its own tools (BRIEF §6.2): no schedule that could never run. + // PostgreSQL is backed up with its own tools (BRIEF §6.2): no schedule that could never run. Seeded due at once + // when the newest copy is a day old, as the daily loop it replaced made one at start. if (DatabaseBackups.Unavailable(_db) is null) { list.Add(new(IndexBackup, "Index backup", ScheduleActions.Backup, ScheduleRecurrence.DailyAt(nightly.Backup), - new ScheduleParametersDto(Keep: DatabaseBackups.Keep))); + new ScheduleParametersDto(Keep: DatabaseBackups.Keep), LastDone: DatabaseBackups.Newest(_db, _archives?.BackupDirectory))); } list.Add(new(Housekeeping, "Housekeeping", ScheduleActions.Cleanup, ScheduleRecurrence.DailyAt(nightly.History), new ScheduleParametersDto(OlderThanDays: _options.JobHistoryDays, Steps: [Chronos.Data.Housekeeping.CleanupSteps.JobHistory]))); diff --git a/tests/Chronos.App.Tests/Jobs/DesktopScheduleHostTests.cs b/tests/Chronos.App.Tests/Jobs/DesktopScheduleHostTests.cs index 977f135c..6d4c592d 100644 --- a/tests/Chronos.App.Tests/Jobs/DesktopScheduleHostTests.cs +++ b/tests/Chronos.App.Tests/Jobs/DesktopScheduleHostTests.cs @@ -128,6 +128,31 @@ public sealed class DesktopScheduleHostTests(TestContext context) Assert.Count(1, DatabaseBackups.List(fx.Backups, fx.DatabasePath)); } + /// + /// The first start after the upgrade: the daily loop made a copy at start once the newest was a day old, so the index + /// backup is seeded due when it is (copied in the first pass); a fresher copy waits for its first day as a new install does. + /// + [Test] + public async Task TheFirstStartAfterTheUpgradeCopiesWhenTheNewestCopyIsADayOld() + { + await using (var stale = await ScheduleFixture.CreateAsync(context)) + { + Directory.CreateDirectory(stale.Backups); + File.WriteAllText(Path.Combine(stale.Backups, $"chronos-{ScheduleFixture.T0.AddDays(-7):yyyyMMdd-HHmmss}-000.db"), "copy"); + await stale.StartAsync(); + var backup = Assert.NotNull(await stale.Db.Schedules.GetBySystemKeyAsync(DesktopScheduleHost.IndexBackup)); + Assert.Equal((ScheduleOutcome.Queued, ScheduleFixture.T0.AddDays(1)), (backup.LastOutcome!, backup.NextRun!.Value)); + Assert.Equal(JobKind.Backup, Assert.NotNull(await stale.Db.Jobs.GetAsync(backup.LastJobId!.Value)).Kind); + } + + await using var fresh = await ScheduleFixture.CreateAsync(context); + Directory.CreateDirectory(fresh.Backups); + File.WriteAllText(Path.Combine(fresh.Backups, $"chronos-{ScheduleFixture.T0.AddHours(-2):yyyyMMdd-HHmmss}-000.db"), "copy"); + await fresh.StartAsync(); + var waiting = Assert.NotNull(await fresh.Db.Schedules.GetBySystemKeyAsync(DesktopScheduleHost.IndexBackup)); + Assert.Equal(((string?)null, ScheduleFixture.T0.AddDays(1)), (waiting.LastOutcome, waiting.NextRun!.Value)); + } + [Test] public async Task TheHousekeepingRemovesOldHistoryAndTrimsTheCache() { diff --git a/tests/Chronos.Core.Tests/Diagnostics/FileLogSinkTests.cs b/tests/Chronos.Core.Tests/Diagnostics/FileLogSinkTests.cs index 95a32d37..7c63a20f 100644 --- a/tests/Chronos.Core.Tests/Diagnostics/FileLogSinkTests.cs +++ b/tests/Chronos.Core.Tests/Diagnostics/FileLogSinkTests.cs @@ -156,6 +156,31 @@ public sealed class FileLogSinkTests(TestContext context) Assert.False(text.Contains("after", StringComparison.Ordinal), text); } + /// + /// A folder removed under a sink (a server's data folder deleted, /data/logs gone) drops lines instead of throwing into + /// the code that logs; once the folder is back, the next line opens the file again. + /// + [Test] + public void ARemovedFolderDropsLinesUntilItIsBack() + { + var dir = Path.Combine(context.CreateTempDirectory(), "logs"); + var time = new ManualTime(new DateTimeOffset(2026, 10, 27, 9, 0, 0, TimeSpan.Zero)); + using var sink = new FileLogSink(dir, "server", new LogFileOptions { RetentionDays = 0 }, time); + Directory.Delete(dir); + + // Before the first line, as a server whose temporary folder a test already deleted. + sink.Write(LogLevel.Error, "jobs", "lost", new InvalidOperationException("cause")); + Assert.False(Directory.Exists(dir), "the sink does not create the folder again by itself"); + + Directory.CreateDirectory(dir); + sink.Write(LogLevel.Error, "jobs", "kept", null); + sink.Write(LogLevel.Info, "jobs", "next", null); + var path = Path.Combine(dir, "server-20261027.log"); + Assert.Equal(path, sink.CurrentPath); + var text = Read(path); + Assert.True(text.Contains("kept", StringComparison.Ordinal) && text.Contains("next", StringComparison.Ordinal) && !text.Contains("lost", StringComparison.Ordinal), text); + } + /// Reads a file the sink may still be writing (it shares it for reading and writing, as the log tail does). private static string Read(string path) { diff --git a/tests/Chronos.Core.Tests/Diagnostics/LogTests.cs b/tests/Chronos.Core.Tests/Diagnostics/LogTests.cs new file mode 100644 index 00000000..7f6ed2e7 --- /dev/null +++ b/tests/Chronos.Core.Tests/Diagnostics/LogTests.cs @@ -0,0 +1,70 @@ +using Chronos.Core.Diagnostics; +using Chronos.Testing; + +namespace Chronos.Core.Tests.Diagnostics; + +/// +/// Logging never throws into the code that logs: the job engine and the scheduler log from their error handling, and a line +/// that escaped there once left a failed job running and could stop a worker. Serial: these tests replace the process-wide sink. +/// +[Serial] +public sealed class LogTests +{ + /// Throws what Microsoft.Extensions.Logging throws when a file provider's folder is gone. + private sealed class BrokenSink : ILogSink + { + public int Calls; + + public void Write(LogLevel level, string category, string message, Exception? exception) + { + Interlocked.Increment(ref Calls); + throw new AggregateException("An error occurred while writing to logger(s).", new DirectoryNotFoundException("Could not find a part of the path")); + } + } + + private sealed class ListSink : ILogSink + { + public List Lines { get; } = []; + + public void Write(LogLevel level, string category, string message, Exception? exception) + { + lock (Lines) Lines.Add($"{level} {category}: {message}"); + } + } + + [Test] + public void ALineASinkCannotWriteIsDroppedWithoutThrowing() + { + var sink = new BrokenSink(); + var previous = Log.Sink; + var level = Log.MinimumLevel; + Log.SetSink(sink); + Log.MinimumLevel = LogLevel.Debug; + try + { + Log.Debug("test", "debug"); + Log.Info("test", "info"); + Log.Warning("test", "warning", new InvalidOperationException("cause")); + Log.Error("test", "error", new InvalidOperationException("cause")); + Log.Write(LogLevel.Error, "test", "write", null); + } + finally + { + Log.SetSink(previous); + Log.MinimumLevel = level; + } + Assert.Equal(5, sink.Calls); + } + + [Test] + public void OneSinkOfATeeThatCannotWriteDoesNotKeepTheLineFromTheOthers() + { + var broken = new BrokenSink(); + var kept = new ListSink(); + var tee = new TeeLogSink(broken, kept); + tee.Write(LogLevel.Warning, "test", "first", null); + tee.Write(LogLevel.Error, "test", "second", new IOException("disk")); + Assert.Equal(2, broken.Calls); + Assert.SequenceEqual(["Warning test: first", "Error test: second"], kept.Lines); + } +} diff --git a/tests/Chronos.Data.Tests/Jobs/LoggingFailureTests.cs b/tests/Chronos.Data.Tests/Jobs/LoggingFailureTests.cs new file mode 100644 index 00000000..3297843d --- /dev/null +++ b/tests/Chronos.Data.Tests/Jobs/LoggingFailureTests.cs @@ -0,0 +1,133 @@ +using System.Threading.Channels; +using Chronos.Core.Diagnostics; +using Chronos.Core.Model; +using Chronos.Data.Archiving; +using Chronos.Data.Jobs; +using Chronos.Data.Scheduling; +using Chronos.Data.Tests.Scheduling; +using Chronos.Protocol; +using Chronos.Testing; + +namespace Chronos.Data.Tests.Jobs; + +/// +/// The job engine and the scheduler log from their error handling: a log line that cannot be written must change nothing +/// they do. It once left a failed job running (its log line threw before the state was stored, the cause of the +/// intermittent JobApiTests failures: the process-wide sink was a stopped test server's, whose log folder was gone) and +/// killed the worker. Serial: these tests replace the process-wide sink. +/// +[Serial] +[Category("jobs")] +public sealed class LoggingFailureTests(TestContext context) +{ + private static readonly DateTimeOffset T0 = new(2026, 10, 2, 9, 0, 0, TimeSpan.Zero); + + private static TimeSpan Budget => TimeSpan.FromSeconds(TestTiming.Budget(10)); + + /// Every line fails as Microsoft.Extensions.Logging fails when a file provider's folder is gone. + private sealed class BrokenLogging : IDisposable, ILogSink + { + private readonly ILogSink _previous = Log.Sink; + private readonly LogLevel _level = Log.MinimumLevel; + private int _lines; + + public BrokenLogging() + { + Log.SetSink(this); + Log.MinimumLevel = LogLevel.Trace; + } + + public int Lines => Volatile.Read(ref _lines); + + public void Write(LogLevel level, string category, string message, Exception? exception) + { + Interlocked.Increment(ref _lines); + throw new AggregateException("An error occurred while writing to logger(s).", new DirectoryNotFoundException("Could not find a part of the path")); + } + + public void Dispose() + { + Log.SetSink(_previous); + Log.MinimumLevel = _level; + } + } + + private sealed class CallbackHandler(JobKind kind, Func run) : IJobHandler + { + public JobKind Kind => kind; + + public Task RunAsync(JobContext context) => run(context); + } + + private async Task OpenAsync() => + await ChronosDatabase.OpenAsync(DatabaseOptions.Sqlite(Path.Combine(context.CreateTempDirectory(), "jobs.db")), context.Cancellation); + + private static async Task WaitForStateAsync(ChronosDatabase db, Guid id, JobState state) + { + var until = DateTime.UtcNow + Budget; + while (DateTime.UtcNow < until) + { + if (await db.Jobs.GetAsync(id) is { } job && job.State == state) return job; + await Task.Delay(20); + } + Assert.Fail($"Job {id} is {(await db.Jobs.GetAsync(id))?.State}, expected {state}"); + return null!; + } + + [Test] + public async Task AFailedJobIsMarkedFailedAndTheWorkerGoesOnWhenLoggingFails() + { + await using var db = await OpenAsync(); + var handler = new CallbackHandler(JobKind.Verify, c => c.Job.TargetLabel == "broken" ? throw new InvalidDataException("unreadable") : Task.CompletedTask); + await using var engine = new JobEngine(db, [handler], new JobEngineOptions { Workers = 1, WorkerId = "t", PollInterval = TimeSpan.FromMilliseconds(100) }); + await engine.StartAsync(); + using var logging = new BrokenLogging(); + + // The engine logs the failure before it stores it: that line failing once left the job running. + var broken = await engine.EnqueueAsync(JobKind.Verify, [], "broken"); + var failed = await WaitForStateAsync(db, broken.Id, JobState.Failed); + Assert.Equal("unreadable", failed.Error); + Assert.Greater(logging.Lines, 0); + + // The one worker is still claiming jobs. + var next = await engine.EnqueueAsync(JobKind.Verify, [], "fine"); + await WaitForStateAsync(db, next.Id, JobState.Done); + } + + [Test] + public async Task TheSchedulerFiresAndRecordsRunsWhenLoggingFails() + { + await using var db = await OpenAsync(); + // Never started: the queued backups stay queued. + await using var engine = new JobEngine(db, new ArchiveService(db).CreateJobHandlers(), new JobEngineOptions { WorkerId = "t" }); + var clock = new ScheduleClock(T0); + // Disposed at the end: a loop that faulted would throw there. + await using var scheduler = new Scheduler(db, engine, new SchedulerOptions { Time = clock, Tick = TimeSpan.FromHours(1) }); + await scheduler.StartAsync(new TestScheduleHost(null), context.Cancellation); + var runs = Channel.CreateUnbounded(); + scheduler.ScheduleChanged += dto => runs.Writer.TryWrite(dto); + var schedule = Assert.NotNull((await scheduler.CreateAsync(new CreateScheduleRequest("Backup", ScheduleActions.Backup, + new RecurrenceDto("every", Every: 10, Unit: "minutes")), null, context.Cancellation)).Schedule); + // From here every line the loop logs (the claim, the outcome, a failed pass) fails. + using var logging = new BrokenLogging(); + + async Task RunAsync(Guid? previousJob) + { + clock.Advance(TimeSpan.FromMinutes(10)); + scheduler.Wake(); + while (true) + { + var dto = await runs.Reader.ReadAsync(context.Cancellation).AsTask().WaitAsync(Budget); + if (dto.Id == schedule.Id && dto.LastOutcome == ScheduleOutcome.Queued && dto.LastJobId != previousJob) return dto; + } + } + + var first = await RunAsync(null); + Assert.Equal(clock.Now, first.LastRun); + await db.Jobs.SetStateAsync(first.LastJobId!.Value, JobState.Done, cancellationToken: context.Cancellation); + // The loop survived the lines it could not write: the next run fires too. + var second = await RunAsync(first.LastJobId); + Assert.Equal(clock.Now, second.LastRun); + Assert.Greater(logging.Lines, 0); + } +} diff --git a/tests/Chronos.Data.Tests/Scheduling/HousekeepingJobTests.cs b/tests/Chronos.Data.Tests/Scheduling/HousekeepingJobTests.cs index c48e9b24..54dff403 100644 --- a/tests/Chronos.Data.Tests/Scheduling/HousekeepingJobTests.cs +++ b/tests/Chronos.Data.Tests/Scheduling/HousekeepingJobTests.cs @@ -60,6 +60,12 @@ public sealed class HousekeepingJobTests(TestContext context) Assert.Contains(backups[0].Path, done.LogTail); Assert.Equal((1L, 1L), (done.ProgressDone, done.ProgressTotal)); Assert.Null(DatabaseBackups.Unavailable(fx.Db)); + + // One folder, one retention: a backup that keeps fewer never deletes the copies the index backup schedule keeps. + await fx.Db.Schedules.EnsureSystemAsync([new Data.Scheduling.SystemSchedule(DatabaseBackups.ScheduleKey, "Index backup", Data.Scheduling.ScheduleActions.Backup, + Data.Scheduling.ScheduleRecurrence.Parse("daily:03:00"), new Protocol.ScheduleParametersDto(Keep: 4))], DateTimeOffset.UtcNow, fx.Ct); + for (var i = 0; i < 3; i++) await RunAsync(fx, engine, ArchiveJobs.Backup(keep: 1)); + Assert.Count(4, DatabaseBackups.List(DatabaseBackups.DefaultDirectory(path), path)); } [Test] diff --git a/tests/Chronos.Data.Tests/Scheduling/SchedulerTests.cs b/tests/Chronos.Data.Tests/Scheduling/SchedulerTests.cs index 64046ea4..e191bc81 100644 --- a/tests/Chronos.Data.Tests/Scheduling/SchedulerTests.cs +++ b/tests/Chronos.Data.Tests/Scheduling/SchedulerTests.cs @@ -1,3 +1,4 @@ +using System.Threading.Channels; using Chronos.Core.Archiving; using Chronos.Core.Model; using Chronos.Data.Archiving; @@ -12,7 +13,10 @@ using Chronos.Testing; namespace Chronos.Data.Tests.Scheduling; -/// A clock the test sets by hand; its timers are real ones, so the scheduler's loop waits in real time (tests drive passes themselves). +/// +/// A clock the test sets by hand; its timers are real ones, so the scheduler's loop waits in real time (most tests drive +/// passes themselves; the loop's own tests give it a short tick or wake it). +/// internal sealed class ScheduleClock(DateTimeOffset start) : TimeProvider { private long _ticks = start.UtcTicks; @@ -43,7 +47,14 @@ internal sealed class TestScheduleHost(Archive? archive) : IScheduleHost public bool DeepAnalysisAfterScan { get; set; } - public ValueTask GetArchiveAsync(CancellationToken cancellationToken) => ValueTask.FromResult(Archive); + /// Awaited before the archive is handed out (a slow drive, a pass the test holds). + public Func? BeforeArchive { get; set; } + + public async ValueTask GetArchiveAsync(CancellationToken cancellationToken) + { + if (BeforeArchive is { } wait) await wait(cancellationToken); + return Archive; + } public string? Unavailable(string action) => Refused.GetValueOrDefault(action); } @@ -529,6 +540,179 @@ public sealed class SchedulerTests(TestContext context) Assert.True(ArchiveJobJson.Read(job, ArchiveJobJson.Default.ScanParameters, new ScanParameters(false)).DeepAnalysis); } + /// + /// Owner review 2, R10: a system schedule that replaced a timer is seeded due when the timer's work was last done a period + /// or more before (the newest index copy a week old: the first start after the upgrade copies at once, as the daily loop + /// did); done more recently, or never, it waits for the recurrence's first occurrence. Rows that exist keep their runs. + /// + [Test] + public async Task ASystemScheduleIsSeededDueWhenItsWorkIsAPeriodOld() + { + await using var fx = await ArchiveFixture.CreateAsync(context); + await using var engine = Engine(fx); + var clock = new ScheduleClock(T0); + var host = new TestScheduleHost(fx.Archive); + var daily = ScheduleRecurrence.Interval(1, RecurrenceUnit.Days); + host.Systems.Add(new SystemSchedule("index-backup", "Index backup", ScheduleActions.Backup, daily, LastDone: T0.AddDays(-7))); + host.Systems.Add(new SystemSchedule("nightly-backup", "Nightly", ScheduleActions.Backup, ScheduleRecurrence.DailyAt(new TimeOnly(3, 0)), LastDone: T0.AddHours(-23))); + host.Systems.Add(new SystemSchedule("new-backup", "New", ScheduleActions.Backup, daily)); + host.Systems.Add(new SystemSchedule("off-backup", "Off", ScheduleActions.Backup, daily, Enabled: false, LastDone: T0.AddDays(-7))); + await using (var first = await StartAsync(fx.Db, engine, host, clock)) + { + var due = (await fx.Db.Schedules.GetBySystemKeyAsync("index-backup", Ct))!; + Assert.Equal((ScheduleOutcome.Queued, T0, T0.AddDays(1)), (due.LastOutcome!, due.LastRun!.Value, due.NextRun!.Value)); + var nightly = (await fx.Db.Schedules.GetBySystemKeyAsync("nightly-backup", Ct))!; + Assert.Equal(((string?)null, new DateTimeOffset(2026, 10, 3, 3, 0, 0, TimeSpan.Zero)), (nightly.LastOutcome, nightly.NextRun!.Value)); + var fresh = (await fx.Db.Schedules.GetBySystemKeyAsync("new-backup", Ct))!; + Assert.Equal(((string?)null, T0.AddDays(1)), (fresh.LastOutcome, fresh.NextRun!.Value)); + var off = (await fx.Db.Schedules.GetBySystemKeyAsync("off-backup", Ct))!; + Assert.Equal(((string?)null, (DateTimeOffset?)null), (off.LastOutcome, off.NextRun)); + } + // The next start finds the rows: nothing is due again. + clock.Advance(TimeSpan.FromHours(1)); + await using var second = await StartAsync(fx.Db, engine, host, clock); + Assert.Count(1, (await fx.Db.Jobs.ListAsync(cancellationToken: Ct)).Items); + } + + /// The loop itself (no pass by hand): its tick fires a due schedule. + [Test] + public async Task TheLoopFiresADueScheduleAtItsTick() + { + await using var fx = await ArchiveFixture.CreateAsync(context); + await using var engine = Engine(fx); + var clock = new ScheduleClock(T0); + await using var scheduler = new Scheduler(fx.Db, engine, new SchedulerOptions { Time = clock, Tick = TimeSpan.FromMilliseconds(100) }); + await scheduler.StartAsync(new TestScheduleHost(fx.Archive), Ct); + var changes = Changes(scheduler); + var schedule = await CreateAsync(scheduler, ScheduleActions.Scan); + + clock.Advance(TimeSpan.FromMinutes(10)); + var ran = await RanAsync(changes, schedule.Id, null); + Assert.Equal((ScheduleOutcome.Queued, T0.AddMinutes(20)), (ran.LastOutcome!, ran.NextRun!.Value)); + Assert.Count(1, await fx.Db.Jobs.ListByScheduleAsync(schedule.Id, cancellationToken: Ct)); + } + + /// makes the loop look now, long before its tick. + [Test] + public async Task WakeFiresADueScheduleBeforeTheTick() + { + await using var fx = await ArchiveFixture.CreateAsync(context); + await using var engine = Engine(fx); + var clock = new ScheduleClock(T0); + await using var scheduler = await StartAsync(fx.Db, engine, new TestScheduleHost(fx.Archive), clock); + var changes = Changes(scheduler); + var schedule = await CreateAsync(scheduler, ScheduleActions.Scan); + + clock.Advance(TimeSpan.FromMinutes(10)); + await Task.Delay(200, Ct); + Assert.Null((await scheduler.GetAsync(schedule.Id, Ct))!.LastOutcome, "the tick is an hour away"); + scheduler.Wake(); + Assert.Equal(ScheduleOutcome.Queued, (await RanAsync(changes, schedule.Id, null)).LastOutcome); + } + + /// Nothing a pass throws (here a subscriber of ) ends the loop: the next run still fires. + [Test] + public async Task TheLoopSurvivesAPassThatThrew() + { + await using var fx = await ArchiveFixture.CreateAsync(context); + await using var engine = Engine(fx); + var clock = new ScheduleClock(T0); + await using var scheduler = await StartAsync(fx.Db, engine, new TestScheduleHost(fx.Archive), clock); + var changes = Changes(scheduler); + var thrown = 0; + scheduler.ScheduleChanged += dto => + { + if (dto.LastOutcome is not null && Interlocked.Exchange(ref thrown, 1) == 0) throw new InvalidOperationException("A subscriber failed"); + }; + var schedule = await CreateAsync(scheduler, ScheduleActions.Duplicates); + + clock.Advance(TimeSpan.FromMinutes(10)); + scheduler.Wake(); + var first = await RanAsync(changes, schedule.Id, null); + Assert.Equal(1, Volatile.Read(ref thrown)); + await fx.Db.Jobs.SetStateAsync(first.LastJobId!.Value, JobState.Done, cancellationToken: Ct); + + clock.Advance(TimeSpan.FromMinutes(10)); + scheduler.Wake(); + var second = await RanAsync(changes, schedule.Id, first.LastJobId); + Assert.Equal((ScheduleOutcome.Queued, T0.AddMinutes(20)), (second.LastOutcome!, second.LastRun!.Value)); + Assert.Count(2, await fx.Db.Jobs.ListByScheduleAsync(schedule.Id, cancellationToken: Ct)); + } + + /// + /// Disposing stops the loop during a pass: it waits for a host call that does not watch its token, so the database is + /// never used after it returns, and cancels one that does. + /// + [Test] + public async Task DisposeDuringAPassWaitsForItAndStopsIt() + { + await using var fx = await ArchiveFixture.CreateAsync(context); + await using var engine = Engine(fx); + var clock = new ScheduleClock(T0); + var host = new TestScheduleHost(fx.Archive); + var gate = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var scheduler = await StartAsync(fx.Db, engine, host, clock); + var disposed = false; + try + { + await CreateAsync(scheduler, ScheduleActions.Scan); + var entered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + host.BeforeArchive = async _ => + { + entered.TrySetResult(); + await gate.Task; + }; + clock.Advance(TimeSpan.FromMinutes(10)); + scheduler.Wake(); + await entered.Task.WaitAsync(Budget, Ct); + + var disposing = scheduler.DisposeAsync().AsTask(); + disposed = true; + await Task.Delay(200, Ct); + Assert.False(disposing.IsCompleted, "disposed while a pass was still running"); + gate.SetResult(); + await disposing.WaitAsync(Budget, Ct); + } + finally + { + gate.TrySetResult(); + if (!disposed) await scheduler.DisposeAsync(); + } + + // A host call that watches the token ends with it. + var again = await StartAsync(fx.Db, engine, host, clock); + var waiting = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + host.BeforeArchive = async ct => + { + waiting.TrySetResult(); + await Task.Delay(Timeout.Infinite, ct); + }; + clock.Advance(TimeSpan.FromMinutes(10)); + again.Wake(); + await waiting.Task.WaitAsync(Budget, Ct); + await again.DisposeAsync().AsTask().WaitAsync(Budget, Ct); + } + + private static TimeSpan Budget => TimeSpan.FromSeconds(TestTiming.Budget(10)); + + /// Every from now on. + private static Channel Changes(Scheduler scheduler) + { + var changes = Channel.CreateUnbounded(); + scheduler.ScheduleChanged += dto => changes.Writer.TryWrite(dto); + return changes; + } + + /// The first change of that records a run whose job is not . + private async Task RanAsync(Channel changes, Guid id, Guid? previousJob) + { + while (true) + { + var dto = await changes.Reader.ReadAsync(Ct).AsTask().WaitAsync(Budget, Ct); + if (dto.Id == id && dto.LastOutcome is not null && dto.LastJobId != previousJob) return dto; + } + } + private static async Task IngestAsync(ArchiveFixture fx, string key, int seed) { var staged = fx.Stage(ArchiveFixture.Start.AddMinutes(seed), seed); diff --git a/tests/Chronos.Data.Tests/Sqlite/DatabaseBackupsTests.cs b/tests/Chronos.Data.Tests/Sqlite/DatabaseBackupsTests.cs index e18d9e78..800247a4 100644 --- a/tests/Chronos.Data.Tests/Sqlite/DatabaseBackupsTests.cs +++ b/tests/Chronos.Data.Tests/Sqlite/DatabaseBackupsTests.cs @@ -1,25 +1,20 @@ using Chronos.Core.Model; using Chronos.Data.Repositories; +using Chronos.Data.Scheduling; +using Chronos.Protocol; using Chronos.Testing; namespace Chronos.Data.Tests.Sqlite; /// -/// BRIEF §6.2: a VACUUM INTO copy of the SQLite index once a day, the newest three kept, and a restore from Settings › -/// Advanced that waits for the next start, runs before the index opens (so it recovers one that no longer opens), checks -/// the copy first (quick_check included) and never replaces a working index with a broken one. +/// BRIEF §6.2: VACUUM INTO copies of the SQLite index (the index backup schedule's, Back up now's, the one kept before a +/// restore), as many kept as the backup schedules keep, and a restore from Settings › Advanced that waits for the next +/// start, runs before the index opens (so it recovers one that no longer opens), checks the copy first (quick_check +/// included) and never replaces a working index with a broken one. /// [Category("sqlite")] public sealed class DatabaseBackupsTests(TestContext context) { - /// A clock the test moves; timers created on it never fire by themselves. - private sealed class ManualClock(DateTimeOffset now) : TimeProvider - { - public DateTimeOffset Now { get; set; } = now; - - public override DateTimeOffset GetUtcNow() => Now; - } - private async Task<(ChronosDatabase Db, string Path)> OpenAsync(string name = "chronos.db") { var path = System.IO.Path.Combine(context.CreateTempDirectory("db"), name); @@ -49,42 +44,55 @@ public sealed class DatabaseBackupsTests(TestContext context) } [Test] - public void ACopyIsDueWhenTheNewestIsADayOld() + public async Task TheNewestCopyIsWhatTheIndexBackupIsSeededWith() { - var now = new DateTimeOffset(2026, 10, 12, 9, 0, 0, TimeSpan.Zero); - Assert.True(DatabaseBackups.IsDue([], now)); - Assert.False(DatabaseBackups.IsDue([new DatabaseBackup("b", now.AddHours(-23), 1)], now)); - Assert.True(DatabaseBackups.IsDue([new DatabaseBackup("b", now.AddHours(-24), 1)], now)); - } - - [Test] - public async Task TheDailyCopyIsMadeAtStartOnlyWhenDue() - { - var (db, _) = await OpenAsync(); + var (db, path) = await OpenAsync(); await using var _ = db; var directory = context.CreateTempDirectory("backups"); - var clock = new ManualClock(DateTimeOffset.UtcNow); + Assert.Null(DatabaseBackups.Newest(db, directory)); + File.WriteAllText(Path.Combine(directory, "chronos-20261010-030000-000.db"), "a"); + File.WriteAllText(Path.Combine(directory, "chronos-20261012-030000-000.db"), "b"); + File.WriteAllText(Path.Combine(directory, "other-20261013-030000-000.db"), "x"); + Assert.Equal(new DateTimeOffset(2026, 10, 12, 3, 0, 0, TimeSpan.Zero), DatabaseBackups.Newest(db, directory)); + // Without a folder of its own, the one next to the index. + Assert.Null(DatabaseBackups.Newest(db, null)); + await db.BackupAsync(DatabaseBackups.DefaultDirectory(path), DatabaseBackups.Keep, context.Cancellation); + Assert.NotNull(DatabaseBackups.Newest(db, null)); + await using var memory = await ChronosDatabase.OpenAsync(DatabaseOptions.SqliteInMemory(), context.Cancellation); + Assert.Null(DatabaseBackups.Newest(memory, directory)); + } - // No copy yet: one is made at once, then the loop waits for its hourly check until stopped. - using (var stop = new CancellationTokenSource()) - { - var loop = DatabaseBackups.RunDailyAsync(db, directory, clock, stop.Token); - var until = DateTime.UtcNow.AddSeconds(20); - while (Directory.GetFiles(directory, "*.db").Length == 0 && DateTime.UtcNow < until) await Task.Delay(20); - await stop.CancelAsync(); - await loop.WaitAsync(TimeSpan.FromSeconds(20)); - } - Assert.Count(1, Directory.GetFiles(directory, "*.db")); + /// + /// One folder, one retention (owner review 2, R10): Back up now and the copy kept before a restore keep as many copies + /// as the backup schedules keep (the largest Copies kept, enabled or not), not a fixed three. + /// + [Test] + public async Task EveryCopyKeepsAsManyAsTheBackupSchedulesKeep() + { + var (db, path) = await OpenAsync(); + var directory = context.CreateTempDirectory("backups"); + Assert.Equal(DatabaseBackups.Keep, await DatabaseBackups.KeptAsync(db, context.Cancellation)); + await db.Schedules.EnsureSystemAsync( + [ + new SystemSchedule(DatabaseBackups.ScheduleKey, "Index backup", ScheduleActions.Backup, ScheduleRecurrence.Parse("every:1d"), new ScheduleParametersDto(Keep: 5)), + new SystemSchedule("other-backup", "Other backup", ScheduleActions.Backup, ScheduleRecurrence.Parse("every:1d"), new ScheduleParametersDto(Keep: 1), Enabled: false), + new SystemSchedule("cleanup", "Clean-up", ScheduleActions.Cleanup, ScheduleRecurrence.Parse("daily:04:00"), new ScheduleParametersDto(Steps: ["audit"], OlderThanDays: 30)), + ], DateTimeOffset.UtcNow, context.Cancellation); + Assert.Equal(5, await DatabaseBackups.KeptAsync(db, context.Cancellation)); - // A fresh copy exists: starting again makes none. - using (var stop = new CancellationTokenSource()) - { - var loop = DatabaseBackups.RunDailyAsync(db, directory, clock, stop.Token); - await Task.Delay(300); - await stop.CancelAsync(); - await loop.WaitAsync(TimeSpan.FromSeconds(20)); - } - Assert.Count(1, Directory.GetFiles(directory, "*.db")); + // Five copies of the schedule, then Back up now: the four newest stay with the new one. + for (var i = 0; i < 5; i++) await db.BackupAsync(directory, 5, context.Cancellation); + var scheduled = DatabaseBackups.List(directory, path).Select(b => b.Path).ToList(); + var manual = await db.BackupAsync(directory, await DatabaseBackups.KeptAsync(db, context.Cancellation), context.Cancellation); + Assert.SequenceEqual([manual, .. scheduled.Take(4)], DatabaseBackups.List(directory, path).Select(b => b.Path)); + + // The copy of the index a restore replaces prunes the same way. + await DatabaseBackups.StageRestoreAsync(scheduled[0], path, context.Cancellation); + await db.DisposeAsync(); + Assert.True(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation)); + var after = DatabaseBackups.List(directory, path).Select(b => b.Path).ToList(); + Assert.Count(5, after); + Assert.SequenceEqual([manual, .. scheduled.Take(3)], after.Skip(1)); } [Test] diff --git a/tests/Chronos.Server.Tests/Storage/ArchiveModuleTests.cs b/tests/Chronos.Server.Tests/Storage/ArchiveModuleTests.cs index 282b7c89..145424e8 100644 --- a/tests/Chronos.Server.Tests/Storage/ArchiveModuleTests.cs +++ b/tests/Chronos.Server.Tests/Storage/ArchiveModuleTests.cs @@ -74,6 +74,32 @@ public sealed class ArchiveModuleTests(TestContext context) Assert.Equal(server.Database.SchemaVersion, summary.SchemaVersion); } + /// + /// The first start after the upgrade: the daily loop copied at start once the newest copy was a day old, so the index + /// backup schedule is seeded due then (copied in the first pass) instead of waiting for 03:00. + /// + [Test] + public async Task TheFirstStartCopiesTheIndexWhenTheNewestCopyIsADayOld() + { + string? backups = null; + await using var server = await TestServer.StartAsync(context, options => + { + backups = Path.Combine(options.DataPath, Chronos.Data.DatabaseBackups.DirectoryName); + Directory.CreateDirectory(backups); + File.WriteAllText(Path.Combine(backups, $"chronos-{DateTime.UtcNow.AddDays(-7):yyyyMMdd-HHmmss}-000.db"), "copy"); + }, ArchiveModule.Register); + + var schedule = Assert.NotNull(await server.Database.Schedules.GetBySystemKeyAsync(ServerScheduleHost.IndexBackup, context.Cancellation)); + Assert.Equal("queued", schedule.LastOutcome); + var path = Assert.NotNull(((Chronos.Data.Sqlite.SqliteDatabase)server.Database.Database).Path); + var until = DateTime.UtcNow + TimeSpan.FromSeconds(TestTiming.Budget(30)); + while (Chronos.Data.DatabaseBackups.List(backups!, path).Count < 2) + { + Assert.True(DateTime.UtcNow < until, "no copy at the first start"); + await Task.Delay(50); + } + } + [Test] public async Task PhotosAlreadyInTheArchiveAndAddedLaterAreIndexedByTheScanScheduleWithThumbnailsAndProxies() {