mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fix the bot starting when using --debuginfo (#6131)
This commit is contained in:
parent
1d828c447c
commit
e7d7eba68f
@ -268,7 +268,7 @@ def _copy_data(data):
|
||||
def early_exit_runner(
|
||||
cli_flags: Namespace,
|
||||
func: Union[Callable[[], Awaitable[Any]], Callable[[Red, Namespace], Awaitable[Any]]],
|
||||
) -> None:
|
||||
) -> NoReturn:
|
||||
"""
|
||||
This one exists to not log all the things like it's a full run of the bot.
|
||||
"""
|
||||
@ -277,6 +277,7 @@ def early_exit_runner(
|
||||
try:
|
||||
if not cli_flags.instance_name:
|
||||
loop.run_until_complete(func())
|
||||
sys.exit(ExitCodes.SHUTDOWN)
|
||||
return
|
||||
|
||||
data_manager.load_basic_configuration(cli_flags.instance_name)
|
||||
@ -288,11 +289,13 @@ def early_exit_runner(
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
print("Aborted!")
|
||||
finally:
|
||||
loop.run_until_complete(asyncio.sleep(1))
|
||||
# note: sleep is unnecessary since we're not making any network connections
|
||||
asyncio.set_event_loop(None)
|
||||
loop.stop()
|
||||
loop.close()
|
||||
|
||||
sys.exit(ExitCodes.SHUTDOWN)
|
||||
|
||||
|
||||
async def run_bot(red: Red, cli_flags: Namespace) -> None:
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user