Update sync interval seconds field. (#1698)

* Update sync interval seconds field.

* If the sync interval was updated, schedule the next sync job wakeup immediately.

* Calculate the next sync time for the scheduler should wake up if we only updated the sync interval.
This commit is contained in:
Todd authored and GitHub committed 2021-11-12 14:55:22 -07:00
1 parent 228be58cc8
commit 5d2b0e94aa
4 files changed
+69 -1

No files matched your search

@@ -237,6 +237,11 @@ func TestCrud(t *testing.T) {
assert.Equal(h.Item.Attributes, map[string]interface{}{"key": "val"})
assert.Equal(h.Item.PreferredEndpoints, []string{"dns:update"})
h, err = hClient.Update(tc.Context(), h.Item.Id, h.Item.Version, hostsets.WithSyncIntervalSeconds(42))
require.NoError(err)
require.NotNil(h)
assert.Equal(int32(42), h.Item.SyncIntervalSeconds)
_, err = hClient.Delete(tc.Context(), h.Item.Id)
assert.NoError(err)
_, err = hClient.Delete(tc.Context(), h.Item.Id)