Skip to content

Commit

Permalink
SC2: don't close all SC2 instances when one quits (ArchipelagoMW#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 authored and agilbert1412 committed Jun 13, 2024
1 parent 98a47a1 commit 0165ff8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion worlds/_sc2common/bot/sc2process.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def add(cls, value):
logger.debug("kill_switch: Add switch")
cls._to_kill.append(value)

@classmethod
def kill(cls, value):
logger.info(f"kill_switch: Process cleanup for 1 process")
value._clean(verbose=False)

@classmethod
def kill_all(cls):
logger.info(f"kill_switch: Process cleanup for {len(cls._to_kill)} processes")
Expand Down Expand Up @@ -116,7 +121,7 @@ def signal_handler(*_args):
async def __aexit__(self, *args):
logger.exception("async exit")
await self._close_connection()
kill_switch.kill_all()
kill_switch.kill(self)
signal.signal(signal.SIGINT, signal.SIG_DFL)

@property
Expand Down

0 comments on commit 0165ff8

Please sign in to comment.