Skip to content

Commit

Permalink
handle flag fetch fail
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc committed Jun 14, 2024
1 parent 080e8f0 commit 23c8b25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/amplitude_experiment/deployment/deployment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ def __periodic_refresh(self):

def refresh(self, initial: bool = False):
self.logger.debug("Refreshing flag configs.")
flag_configs = self.flag_config_api.get_flag_configs()
try:
flag_configs = self.flag_config_api.get_flag_configs()
except Exception as e:
self.logger.error(f'Failed to fetch flag configs: {e}')
if initial:
raise Exception
return
flag_keys = {flag['key'] for flag in flag_configs}
self.flag_config_storage.remove_if(lambda f: f.key not in flag_keys)

Expand Down

0 comments on commit 23c8b25

Please sign in to comment.