feat(go): scheduled bank sync (Go only)
The Go server now runs sync -> infer -> flush-cache by itself at the times in SYNC_SCHEDULE (comma-separated HH:MM, default 04:00, "off" disables), read in SYNC_TZ (default Europe/Prague). Nothing runs at startup; an invalid value stops the server with an error. - internal/scheduler: time-of-day parsing, Next, and the run loop - banksync.Runner: one lock shared by /sync-bank and the scheduler so runs never overlap, plus the status of the last run - footer shows the last sync since start and the next scheduled run - binary embeds time/tzdata because the Alpine image has no zone data Deliberately not implemented in the legacy Python app, which is being phased out; recorded in CLAUDE.md under "Deliberately Go-only features". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,9 @@ type ActionHandlers struct {
|
||||
// BankSync runs sync+infer and writes a human-readable log to out.
|
||||
// nil disables the /sync-bank action (renders an error instead).
|
||||
BankSync func(ctx context.Context, out io.Writer) error
|
||||
// SyncInfo returns a one-line summary of the last and next bank sync for
|
||||
// the page footer. nil or an empty result shows nothing.
|
||||
SyncInfo func() string
|
||||
}
|
||||
|
||||
// Run registers routes and starts the HTTP server on addr.
|
||||
|
||||
Reference in New Issue
Block a user