Skip to content

Commit

Permalink
wait async too many
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 4, 2024
1 parent e59fe86 commit fe29484
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ofscraper/classes/sessionmanager/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def is_rate_limited(exception, sleeper):
sleeper.toomany_req()


def async_is_rate_limited(exception, sleeper):
async def async_is_rate_limited(exception, sleeper):
if is_provided_exception_number(exception, 429, 504):
sleeper.async_toomany_req()
await sleeper.async_toomany_req()


def async_check_400(exception):
Expand Down Expand Up @@ -520,7 +520,7 @@ async def requests_async(
log.traceback_(E)
log.traceback_(traceback.format_exc())
if TOO_MANY in exceptions:
async_is_rate_limited(E, sleeper)
await async_is_rate_limited(E, sleeper)
sem.release()
raise E
yield r
Expand Down

0 comments on commit fe29484

Please sign in to comment.