From 0e8a8e5c2ca119e69414e9bd9d298105142ce77a Mon Sep 17 00:00:00 2001 From: Yan Zhang <2351748+Eskibear@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:02:25 +0800 Subject: [PATCH] Update example to explicitly enable refresh In latest design, RefreshOptions.enabled specifies whether the refresh is enabled, false by default. Otherwise it throws error "Refresh is not enabled" when calling settings.refresh(). --- examples/refresh.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/refresh.mjs b/examples/refresh.mjs index 12231fcb..68e7aaab 100644 --- a/examples/refresh.mjs +++ b/examples/refresh.mjs @@ -24,6 +24,7 @@ const settings = await load(connectionString, { }], trimKeyPrefixes: ["app.settings."], refreshOptions: { + enabled: true, watchedSettings: [{ key: "app.settings.sentinel" }], refreshIntervalInMs: 10 * 1000 // Default value is 30 seconds, shorted for this sample } @@ -41,4 +42,4 @@ while (true) { // Waiting before the next refresh await sleepInMs(5000); -} \ No newline at end of file +}