Skip to content

Commit

Permalink
Fix: add no wait in endpoint to skip graceful timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun-m committed Dec 19, 2024
1 parent ef1d97f commit 2cce7bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sdk/src/beta9/runner/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,7 @@ def shutdown(self, signum=None, frame=None):
"timeout": cfg.timeout,
}

if os.environ.get("no_wait") == "true":
options["graceful_timeout"] = 0

GunicornApplication(Starlette(), options).run()
5 changes: 4 additions & 1 deletion sdk/src/beta9/runner/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def run(self, *, command: List[str]) -> None:
" ".join(command),
shell=True,
preexec_fn=os.setsid,
env=os.environ,
env={
**os.environ,
"no_wait": "true",
},
stdout=sys.stdout,
stderr=sys.stdout,
)
Expand Down

0 comments on commit 2cce7bd

Please sign in to comment.