Skip to content

Commit

Permalink
fix: better exception handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yhlong00 committed Jan 31, 2025
1 parent 2c62255 commit 05b2848
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runpod/serverless/modules/rp_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async def get_jobs(self, session: ClientSession):
except asyncio.CancelledError:
log.debug("JobScaler.get_jobs | Request was cancelled.")
raise # CancelledError is a BaseException
except TimeoutError:
except asyncio.TimeoutError:
log.debug("JobScaler.get_jobs | Job acquisition timed out. Retrying.")
except TypeError as error:
log.debug(f"JobScaler.get_jobs | Unexpected error: {error}.")
Expand All @@ -211,7 +211,7 @@ async def get_jobs(self, session: ClientSession):
)
finally:
# Yield control back to the event loop
await asyncio.sleep(0)
await asyncio.sleep(0.1)

async def run_jobs(self, session: ClientSession):
"""
Expand Down

0 comments on commit 05b2848

Please sign in to comment.