mirror of
https://github.com/MrSedan/neuro-reply-bot-reworked.git
synced 2026-01-14 21:49:42 +03:00
Use uvloop in linux
This commit is contained in:
4
main.py
4
main.py
@@ -57,9 +57,13 @@ if __name__ == '__main__':
|
||||
finally:
|
||||
loop.close()
|
||||
else:
|
||||
import uvloop
|
||||
for signame in ('SIGINT', 'SIGTERM'):
|
||||
loop.add_signal_handler(getattr(signal, signame), loop.stop)
|
||||
try:
|
||||
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||
loop = uvloop.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
asyncio.run(main())
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
@@ -4,4 +4,5 @@ requests==2.31.0
|
||||
python-dateutil==2.8.2
|
||||
aiohttp==3.8.6
|
||||
pydantic==2.3.0
|
||||
pydantic-settings==2.1.0
|
||||
pydantic-settings==2.1.0
|
||||
uvloop==0.19.0; sys.platform == 'linux'
|
||||
Reference in New Issue
Block a user