Remove event loop customization (#11)
Reviewed-on: #11 Co-authored-by: Madis Mägi <madis.magi@k-space.ee> Co-committed-by: Madis Mägi <madis.magi@k-space.ee>
This commit is contained in:
parent
8a63100dc8
commit
bb3046db6a
@ -2,7 +2,7 @@ from datetime import datetime
|
|||||||
from sanic import Sanic, response
|
from sanic import Sanic, response
|
||||||
from sanic.response import text, json, stream
|
from sanic.response import text, json, stream
|
||||||
from motor.motor_asyncio import AsyncIOMotorClient
|
from motor.motor_asyncio import AsyncIOMotorClient
|
||||||
import uvloop, asyncio
|
import asyncio
|
||||||
import pymongo
|
import pymongo
|
||||||
import os
|
import os
|
||||||
import const
|
import const
|
||||||
@ -59,6 +59,4 @@ async def view_longpoll(request):
|
|||||||
return stream(g, content_type="text/event-stream")
|
return stream(g, content_type="text/event-stream")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) # swap default event loop to uvloop
|
app.run(debug=False, host='::')
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
app.run(host='::', debug=False, loop=loop)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user