diff options
| author | Nathan Perry <avaglir@gmail.com> | 2017-07-26 18:44:26 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2017-07-26 18:44:26 -0400 |
| commit | 4fea572cb19936bd1bb57e084750b852d46291e0 (patch) | |
| tree | c9c002a07067978e8ae3416535ca4c4876072fa9 | |
| parent | 4dce28a53b9200ad8796f5764b5dd7f3e22d76d5 (diff) | |
check for loop closepython
| -rwxr-xr-x | bot.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -342,6 +342,10 @@ loop = get_event_loop() loop.set_debug(True) while True: + if loop.is_closed(): + print('Event loop closed. Exiting.') + exit() + try: logger.info('starting') loop.run_until_complete(client.start(config['username'], config['password'])) @@ -358,4 +362,3 @@ while True: loop.close() except Exception: logger.exception('main loop') - |
