feat: update settings move under updates, with an interval
updates.autoCheck (was updateCheck) and updates.updateSources (was releases) sit together with updates.autoCheckInterval, a duration (24h by default) for how often lazysecrets looks for a newer release on its own.
This commit is contained in:
9 files changed
+66
-34
No files matched your search
@@ -83,6 +83,12 @@ func TestUpdate(t *testing.T) {
|
||||
if f2.asked != 1 {
|
||||
t.Errorf("asked %d times a day later", f2.asked)
|
||||
}
|
||||
// With autoCheckInterval: 1h, two hours on is long enough.
|
||||
mem.SetUpdateCheck(store.UpdateCheck{At: time.Now().Add(-2 * time.Hour), Tag: "v0.2.0"})
|
||||
newDriverOpts(t, Options{Version: "0.1.1", Updater: f2.updater(), UpdateCheck: true, UpdateEvery: time.Hour, Store: mem})
|
||||
if f2.asked != 2 {
|
||||
t.Errorf("asked %d times, want a look after the hour", f2.asked)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateAsked(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user