Skip to content

Commit

Permalink
Bugfixes:
Browse files Browse the repository at this point in the history
 - remember to update the client when reading from fallback backup file
 - register before sending metrics
  • Loading branch information
rarruda committed Jul 5, 2018
1 parent ab7d14b commit 99af7b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/unleash/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def initialize(*opts)
Unleash.logger.level = Unleash.configuration.log_level

Unleash.toggle_fetcher = Unleash::ToggleFetcher.new
register

unless Unleash.configuration.disable_metrics
Unleash.toggle_metrics = Unleash::Metrics.new
Expand All @@ -25,7 +26,6 @@ def initialize(*opts)
Unleash.reporter.send
end
end
register
end

def is_enabled?(feature, context = nil, default_value = false)
Expand Down
2 changes: 1 addition & 1 deletion lib/unleash/toggle_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def initialize
rescue Exception => e
Unleash.logger.warn "ToggleFetcher was unable to fetch from the network, attempting to read from backup file."
read!
raise e
end

# once we have initialized, start the fetcher loop
Expand Down Expand Up @@ -131,6 +130,7 @@ def read!

backup_as_hash = JSON.parse(line_cache)
synchronize_with_local_cache!(backup_as_hash)
update_client!

rescue IOError => e
Unleash.logger.error "Unable to read the backup_file."
Expand Down

0 comments on commit 99af7b4

Please sign in to comment.