Skip to content

Commit a421768

Browse files
Merge pull request #99 from runpod/refresh_worker-fix
Refresh worker fix
2 parents edb4bd4 + 8e3c55f commit a421768

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

runpod/serverless/modules/rp_job.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ async def run_job(handler: Callable, job: Dict[str, Any]) -> Dict[str, Any]:
113113
if isinstance(job_output, dict):
114114

115115
if job_output.get("error", False):
116-
run_result = {"error": str(job_output["error"])}
116+
run_result["error"] = str(run_result["output"].pop("error"))
117117

118118
if job_output.get("refresh_worker", False):
119-
job_output.pop("refresh_worker")
120-
run_result = {
121-
"stopPod": True,
122-
"output": job_output
123-
}
119+
run_result["stopPod"] = True
120+
run_result["output"].pop("refresh_worker")
121+
122+
if run_result["output"] == {}:
123+
run_result.pop("output")
124124

125125
elif isinstance(job_output, bool):
126126
run_result = {"output": job_output}

0 commit comments

Comments
 (0)