Skip to content

Commit

Permalink
handle other possible states, add return
Browse files Browse the repository at this point in the history
  • Loading branch information
elewis2 committed Jul 9, 2024
1 parent 3a3e594 commit ef0ca7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pori_python/ipr/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ def check_status(interval: int = 5, num_attempts: int = 5):
logger.info(f'checking report loading status in {interval} seconds')
time.sleep(interval)
current_status = self.get(f'reports-async/{report_id}')
if current_status['state'] not in ['active', 'ready']:
if current_status['state'] not in ['active', 'ready', 'waiting', 'completed']:
raise Exception(
f'async report upload in unexpected state: {current_status}'
)
if current_status['state'] == 'ready':
if current_status['state'] in ['ready', 'completed']:
return current_status
return current_status

current_status = check_status()
if current_status['state'] == 'active':
Expand Down

0 comments on commit ef0ca7b

Please sign in to comment.