Skip to content

Commit

Permalink
Merge pull request #98 from eino/feat/disable-shutdown-timeout
Browse files Browse the repository at this point in the history
feat(timeout): allow server without shutdown timeout
  • Loading branch information
jourdain authored Apr 26, 2022
2 parents f9e2492 + 3200728 commit 47e00e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/src/wslink/backends/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ async def _on_startup(app):

def _schedule_shutdown(app):
timeout = app["state"]["server_config"]["timeout"]
app["state"]["shutdown_task"] = schedule_coroutine(timeout, _stop_server, app)
app["state"]["shutdown_task"] = (
schedule_coroutine(timeout, _stop_server, app)
if timeout > 0
else None
)


async def _root_handler(request):
Expand Down
2 changes: 1 addition & 1 deletion python/src/wslink/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def add_arguments(parser):
"--timeout",
type=int,
default=300,
help="timeout for reaping process on idle in seconds (default: 300s)",
help="timeout for reaping process on idle in seconds (default: 300s, 0 to disable)",
)
parser.add_argument(
"-c",
Expand Down

0 comments on commit 47e00e7

Please sign in to comment.