mirror of
https://github.com/solero/houdini.git
synced 2024-11-25 15:07:24 +00:00
Shutdown more gracefully for KeyboardInterrupt
This commit is contained in:
parent
fa8abed189
commit
ac246fda18
@ -1,5 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
import logging
|
||||||
from houdini.houdini import HoudiniFactory
|
from houdini.houdini import HoudiniFactory
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -7,5 +8,9 @@ if __name__ == '__main__':
|
|||||||
loop = asyncio.ProactorEventLoop()
|
loop = asyncio.ProactorEventLoop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
logger = logging.getLogger('houdini')
|
||||||
factory_instance = HoudiniFactory(server='Login')
|
factory_instance = HoudiniFactory(server='Login')
|
||||||
asyncio.run(factory_instance.start())
|
try:
|
||||||
|
asyncio.run(factory_instance.start())
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info('Shutting down...')
|
||||||
|
Loading…
Reference in New Issue
Block a user