Skip to content

Commit

Permalink
fix: Add error handling to local evaluation flag poller
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Yiu authored and Tim Yiu committed Oct 17, 2023
1 parent 4146a29 commit ddda05e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/experiment/local/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ def parse_results(result, flag_keys, user)

def run
@is_running = true
flags = @fetcher.fetch_v1
@flags_mutex.synchronize do
@flags = flags
begin
flags = @fetcher.fetch_v1
@flags_mutex.synchronize do
@flags = flags
end
rescue StandardError => e
@logger.error("[Experiment] Flag poller - error: #{e.message}")
end
@poller_thread = Thread.new do
sleep(@config.flag_config_polling_interval_millis / 1000.to_f)
Expand Down

0 comments on commit ddda05e

Please sign in to comment.