Skip to content

Commit

Permalink
Fix sleep time conditional (#644)
Browse files Browse the repository at this point in the history
- Conditional for sleep time should check sleep_time not time_delta

Example error: https://demo.sentry.io/issues/6131235906/events/3235cb0fb30d45da956bc065ad6f562b/?project=5808655
  • Loading branch information
lukemun authored Dec 11, 2024
1 parent d72684b commit faf3b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flask/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def get_api_request(key, delay):

time_delta = time.time() - start_time
sleep_time = delay - time_delta
if time_delta > 0:
if sleep_time > 0:
time.sleep(sleep_time)

# For demo show we want to show cache misses so only save 1 / 100
Expand Down

0 comments on commit faf3b5d

Please sign in to comment.