SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Task <Task pending coro=<ASGIHTTPConnection.handle_request()
  2. running at /home/user/.local/lib/python3.7/site-packages/quart
  3. /asgi.py:59> cb=[_wait.<locals>._on_completion() at /usr/lib/python3.7
  4. /asyncio/tasks.py:440]> got Future <Future pending cb=[run_on_executor.
  5. <locals>._call_check_cancel() at /home/user/.local/lib/python3.7/site-
  6. packages/motor/frameworks/asyncio/__init__.py:80]> attached to a
  7. different loop
  8.      
  9. # Mongodb / Gridfs with Motor
  10.     import motor.motor_asyncio
  11.     from pymongo import ReturnDocument
  12.     from bson.objectid import ObjectId
  13.     from bson.son import SON
  14.  
  15.     client = motor.motor_asyncio.AsyncIOMotorClient()
  16.     db = client.myDataBase
  17.     fs = motor.motor_asyncio.AsyncIOMotorGridFSBucket(db)
  18.      
  19. app = Quart(__name__)
  20.      
  21. loop=asyncio.new_event_loop()
  22.     asyncio.set_event_loop(loop)
  23.     client = motor.motor_asyncio.AsyncIOMotorClient(io_loop=loop)
  24.      
  25. try:
  26.         session_info = await db.sessions.find_one(
  27.             {
  28.                 'session_id': uuid.UUID(session_id)
  29.             },
  30.             {
  31.                 'username':True,
  32.                 '_id':False
  33.             }
  34.         )
  35.     except Exception as e:
  36.         print('error retrieving session info:', e)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top