Skip to content

Commit cc5301c

Browse files
Merge pull request #158 from runpod/fix-double-job
Fix double job
2 parents c9057c8 + 84258ea commit cc5301c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runpod/serverless/modules/rp_job.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ async def run_job(handler: Callable, job: Dict[str, Any]) -> Dict[str, Any]:
112112
run_result = {"error": "No output from handler."}
113113

114114
try:
115-
job_output = await handler(job) if inspect.isawaitable(handler(job)) else handler(job)
115+
handler_return = handler(job)
116+
job_output = await handler_return if inspect.isawaitable(handler_return) else handler_return
117+
116118
log.debug(f'{job["id"]} | Handler output: {job_output}')
117119

118120
if isinstance(job_output, dict):

0 commit comments

Comments
 (0)