Skip to content

Commit 0961922

Browse files
authored
fix: Prevent uninitialized SDK warning in daemon mode. (#162)
When using daemon mode a warning would be produced on variation calls that the SDK had not finished initialization. This situation doesn't apply to daemon mode where we only read from the persistent store. It is instead intended to apply to persistent store modes where the SDK is writing to the persistence and applies to evaluations between SDK startup and initialization being complete. This change updates the null update process to immediately report that it is initialized.
1 parent bb5bc81 commit 0961922

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ldclient_update_null_server.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ start_link(Tag) ->
3636
-spec init(Args :: term()) ->
3737
{ok, State :: state()} | {ok, State :: state(), timeout() | hibernate} |
3838
{stop, Reason :: term()} | ignore.
39-
init([_Tag]) ->
39+
init([Tag]) ->
4040
% Need to trap exit so supervisor:terminate_child calls terminate callback
4141
process_flag(trap_exit, true),
42+
% When using the null update processor we are always initialized.
43+
ldclient_update_processor_state:set_initialized_state(Tag, true),
4244
State = #{},
4345
{ok, State}.
4446

0 commit comments

Comments
 (0)