Skip to content

Commit

Permalink
prompt exception when on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleLittleCloud committed Dec 11, 2024
1 parent 2742618 commit 6b60a86
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import logging
import signal
import sys
import uuid
import warnings
from asyncio import Future, Task
Expand Down Expand Up @@ -309,6 +310,10 @@ async def stop_when_shutdown(self) -> None:

async def stop_when_signal(self, signals: Sequence[signal.Signals] = (signal.SIGTERM, signal.SIGINT)) -> None:
"""Stop the runtime when a signal is received."""

# check if it's running on linux or windows
if sys.platform == "win32":
raise NotImplementedError("Signal handling is not supported on Windows. Please use stop_when_shutdown instead.")
loop = asyncio.get_running_loop()
shutdown_event = asyncio.Event()

Expand Down

0 comments on commit 6b60a86

Please sign in to comment.