Skip to content

Commit

Permalink
reformat, fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
elewis2 committed Jul 9, 2024
1 parent fefd253 commit 75d23b8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pori_python/ipr/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ def check_status(interval: int = 5, num_attempts: int = 5):
return current_status

current_status = check_status()

if current_status['state'] in ['active', 'waiting']:
current_status = check_status(interval=30)
if current_status['state'] == ['active', 'waiting']:
current_status = check_status(interval=60, num_attempts=mins_to_wait)
if current_status['state'] == ['active', 'waiting']:
raise Exception(
f'async report upload taking longer than expected: {current_status}'
)

if current_status['state'] in ['active', 'waiting']:
current_status = check_status(interval=60, num_attempts=mins_to_wait)

if current_status['state'] in ['active', 'waiting']:
raise Exception(
f'async report upload taking longer than expected: {current_status}'
)
return current_status
else:
return self.post('reports', content)
Expand Down

0 comments on commit 75d23b8

Please sign in to comment.