Browse Source

using nonblocking curio.spawn insted of blocking curio.run to run async functions

digital 7 years ago
parent
commit
12273a3cbb
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/beewatch/server/__init__.py

+ 3 - 3
lib/beewatch/server/__init__.py

@@ -80,9 +80,9 @@ class ConnHandlerBeeWatch(digilib.network.ConnHandlerBase):
         try:
             retval = func(**kwargs)
             if hasattr(retval,"__await__"):
-                lserver.debug("curio.run started")
-                task = curio.run(retval)
-                lserver.debug("curio.run finished")
+                lserver.debug("curio.spawn started")
+                task = curio.spawn(retval)
+                lserver.debug("curio.spawn finished")
         except Exception as e:
             lserver.error("Error while calling api func",exc_info=e)
             tb = traceback.format_exc()