fix(config-backup): a self-refreshed discovery timestamp is not a change

custom-model-hosts.json carries a lastDiscoveredAt per host that the 5-minute model
discovery poll rewrites, so the content hash never matched the latest snapshot and a
snapshot was written every tick. At the default keep count of 20 that left about 100
minutes of history and evicted every useful older copy.

The change check now looks through volatile keys per tracked file. The snapshot still
stores the file as written and restore still verifies against its own digest.
This commit is contained in:
Devvyn committed 2026-10-20 18:01:42 +08:00
1 parent 3756f8b5c2
commit 06182c6fce
3 files changed
+73 -3

No files matched your search

+4
View File
@@ -37,6 +37,10 @@ cron jobs.
- **Whenever the content changes.** The files are read and hashed every five minutes; a new
backup is written only if the set differs from the latest backup. An idle server writes
nothing, and the history is one entry per real change rather than one per timer tick.
A field a file refreshes by itself is not a change: `custom-model-hosts.json` carries a
`lastDiscoveredAt` per host that the model-discovery poll rewrites every five minutes, and
the comparison looks through it (the snapshot still stores the file exactly as written).
Without that, every tick looked like an edit and 20 copies covered only about 100 minutes.
- **On demand**, with **Back up now** (always writes one, even if nothing changed).
- **Before a restore**, as a `pre-restore` safety copy of the files about to be replaced.