mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-07 23:25:51 -08:00
Compare commits
2 Commits
core_manif
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b53f9d3773 | ||
|
|
3ecd856e29 |
@@ -727,6 +727,7 @@ class CollectionState():
|
||||
advancements: Set[Location]
|
||||
path: Dict[Union[Region, Entrance], PathValue]
|
||||
locations_checked: Set[Location]
|
||||
"""Internal cache for Advancement Locations already checked by this CollectionState. Not for use in logic."""
|
||||
stale: Dict[int, bool]
|
||||
allow_partial_entrances: bool
|
||||
additional_init_functions: List[Callable[[CollectionState, MultiWorld], None]] = []
|
||||
|
||||
@@ -21,7 +21,7 @@ import time
|
||||
import typing
|
||||
import weakref
|
||||
import zlib
|
||||
from signal import SIGINT, SIGTERM
|
||||
from signal import SIGINT, SIGTERM, signal
|
||||
|
||||
import ModuleUpdate
|
||||
|
||||
@@ -2742,12 +2742,23 @@ async def main(args: argparse.Namespace):
|
||||
ctx.shutdown_task = asyncio.create_task(auto_shutdown(ctx, [console_task]))
|
||||
|
||||
def stop():
|
||||
for remove_signal in [SIGINT, SIGTERM]:
|
||||
asyncio.get_event_loop().remove_signal_handler(remove_signal)
|
||||
try:
|
||||
for remove_signal in [SIGINT, SIGTERM]:
|
||||
asyncio.get_event_loop().remove_signal_handler(remove_signal)
|
||||
except NotImplementedError:
|
||||
pass
|
||||
ctx.commandprocessor._cmd_exit()
|
||||
|
||||
for signal in [SIGINT, SIGTERM]:
|
||||
asyncio.get_event_loop().add_signal_handler(signal, stop)
|
||||
def shutdown(signum, frame):
|
||||
stop()
|
||||
|
||||
try:
|
||||
for sig in [SIGINT, SIGTERM]:
|
||||
asyncio.get_event_loop().add_signal_handler(sig, stop)
|
||||
except NotImplementedError:
|
||||
# add_signal_handler is only implemented for UNIX platforms
|
||||
for sig in [SIGINT, SIGTERM]:
|
||||
signal(sig, shutdown)
|
||||
|
||||
await ctx.exit_event.wait()
|
||||
console_task.cancel()
|
||||
|
||||
Reference in New Issue
Block a user