controller v0.296.0: a backup run cut off by a power cut or restart is said on the backup pages (R-519); the whole-system backup text states today's measurement (R-518)
gates / gates (push) Successful in 30s
gates / gates (push) Successful in 30s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
477e2548db
commit
ff69074514
21 files changed
+2700
-21
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/backup"
|
||||
)
|
||||
|
||||
// R-519 (v0.296.0) — an app-data backup run cut off by a power cut or a restart is said on the backup pages until
|
||||
// the next complete run (internal/backup/run_record.go). main() calls this right after the restore record, before
|
||||
// any page or any backup run can read the manager. Pinned by TestMainWiresRunRecord.
|
||||
|
||||
// runRecordFileName lives in DataDir, beside settings.json and the restore record.
|
||||
const runRecordFileName = "appdata-run.json"
|
||||
|
||||
func loadRunRecordAtStartup(mgr *backup.Manager, dataDir string, logger *log.Logger) time.Time {
|
||||
if mgr == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
path := filepath.Join(dataDir, runRecordFileName)
|
||||
mgr.SetRunRecordPath(path)
|
||||
cut := mgr.LoadRunRecord()
|
||||
if logger != nil {
|
||||
if !cut.IsZero() {
|
||||
logger.Printf("[WARN] [backup] the app-data backup run started %s was cut off by the stop — the backup pages say so until the next complete run (R-519)", cut.UTC().Format(time.RFC3339))
|
||||
} else {
|
||||
logger.Printf("[INFO] [backup] app-data run record wired: %s (an earlier cut still shown: %t)", path, !mgr.InterruptedRunAt().IsZero())
|
||||
}
|
||||
}
|
||||
return cut
|
||||
}
|
||||
Reference in new issue
Block a user