feat: refresh accounts automatically every five minutes

This commit is contained in:
2026-08-14 15:35:27 +08:00
parent c1985852e1
commit 5f50669b98
11 changed files with 66 additions and 145 deletions
+13
View File
@@ -349,6 +349,19 @@ func TestPeakDailyTokensUsesOnlyTheCurrentTokenCycle(t *testing.T) {
}
}
func TestAutomaticSyncIntervalIsFixedAtFiveMinutes(t *testing.T) {
a := newReminderTestApp(t)
if err := a.store.SetJSON("general", GeneralSettings{SyncMinutes: 60, RetentionDays: 90, BeforeMinutes: 30}); err != nil {
t.Fatal(err)
}
if got := a.general().SyncMinutes; got != automaticSyncMinutes {
t.Fatalf("sync minutes = %d; want %d", got, automaticSyncMinutes)
}
if automaticSyncInterval != 5*time.Minute {
t.Fatalf("automatic sync interval = %s; want 5m", automaticSyncInterval)
}
}
func TestFlattenLimitReadsAppServerWindowDuration(t *testing.T) {
var limit rawLimit
if err := json.Unmarshal([]byte(`{