diff --git a/app.go b/app.go index c11a9cf..56c69e5 100644 --- a/app.go +++ b/app.go @@ -1021,6 +1021,13 @@ func (a *App) startup(ctx context.Context) { return } a.dataDir = dataDir + // The watchlist needs nothing but its file, so it opens FIRST. It used to be + // created after the logbook connect, and a remote MySQL dial of 10-30 s left + // the tab saying "Watchlist: 0" until the next refresh tick — twenty seconds + // of an empty list for a JSON file that reads in a millisecond. (The + // auto-contest pattern still loads later, once the settings store is open.) + a.watchlist = watchlist.New(filepath.Join(dataDir, "watchlist.json")) + a.watchAlertAt = map[string]time.Time{} // Settings/config database (settings + profiles). Fresh installs use // settings.db; existing installs keep their opslog.db (which also held the // QSOs before they were split into a dedicated logbook file — see below). @@ -1391,8 +1398,6 @@ func (a *App) startup(ctx context.Context) { // POTA: background poller of api.pota.app so cluster spots can be tagged // when the DX station is currently activating a park. Best-effort. a.pota = pota.New(func(format string, args ...any) { applog.Printf(format, args...) }) - a.watchlist = watchlist.New(filepath.Join(a.dataDir, "watchlist.json")) - a.watchAlertAt = map[string]time.Time{} a.watchPattern.Store(strings.ToUpper(strings.TrimSpace(a.settingOr(keyWatchlistContestPattern, "")))) go a.pota.Run(a.ctx)