You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add shared file data code with reload, retry, and polling
Adds ldclient.impl.integrations.files.filedata, the file reading, parsing,
and merging logic shared by the components that load flag and segment data
from local files. A document that starts with an opening brace is parsed as
JSON and any other document as YAML, so JSON files no longer depend on the
YAML parser. Definitions are decoded into the flag and segment models while
the file is read, so an invalid definition fails that load instead of failing
later inside the store. Files are merged in the configured order with a
duplicate keys handling of fail or ignore.
The Reloader owns the reload cycle: it serializes reloads, debounces change
signals with a settle window, keeps the last good data by not applying a
failed load, retries a failed load after a bounded delay, reports an identical
failure once, and skips an application whose file contents did not change. It
can treat a configured file that does not exist as a file with no content.
The Poller detects changes by comparing modification time and size on an
interval, including files that appear or disappear. The Watcher uses the
watchdog package, watches the directory of each file so an absent file is
picked up when it appears, matches the destination of a move so a file written
by rename is detected, and retries a directory that does not exist yet.
Both file data sources are rebuilt on this module. Their files must still
exist and duplicate keys still fail the load. The FDv2 synchronizer now keeps
the last good data across a failed load, reports an interrupted state, and
retries, where before a failed initial load ended the synchronizer. The
expansion of a flagValues entry is now an off flag serving its single
variation, which is the form the Go SDK uses, so the evaluation reason kind
for such a flag is OFF.
0 commit comments