stabilize async loops
This commit is contained in:
1 parent
d934dc0ef7
commit
c71b0a9642
2 files changed
-5
No files matched your search
@@ -6,7 +6,6 @@ from quart_auth import (
|
|||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import asyncio
|
import asyncio
|
||||||
import nest_asyncio
|
|
||||||
import traceback
|
import traceback
|
||||||
from stream import Stream
|
from stream import Stream
|
||||||
from tool import ToolSpec, ToolParameter
|
from tool import ToolSpec, ToolParameter
|
||||||
@@ -27,8 +26,6 @@ def encode_json(value):
|
|||||||
return json.dumps(value, default=encode_unknown)
|
return json.dumps(value, default=encode_unknown)
|
||||||
|
|
||||||
async def start_server(app):
|
async def start_server(app):
|
||||||
nest_asyncio.apply()
|
|
||||||
|
|
||||||
server = Quart(__name__, static_folder=frontend_path)
|
server = Quart(__name__, static_folder=frontend_path)
|
||||||
server.secret_key = 'horde-secret'
|
server.secret_key = 'horde-secret'
|
||||||
auth_manager = QuartAuth(server, mode="bearer")
|
auth_manager = QuartAuth(server, mode="bearer")
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import nest_asyncio
|
|
||||||
|
|
||||||
id_counter = 0
|
id_counter = 0
|
||||||
|
|
||||||
@@ -59,7 +58,6 @@ class Stream:
|
|||||||
app.streams[self.id] = self
|
app.streams[self.id] = self
|
||||||
|
|
||||||
def listen (self, chunk_fn, end_fn):
|
def listen (self, chunk_fn, end_fn):
|
||||||
nest_asyncio.apply()
|
|
||||||
chunk_fn = make_runnable(chunk_fn)
|
chunk_fn = make_runnable(chunk_fn)
|
||||||
end_fn = make_runnable(end_fn)
|
end_fn = make_runnable(end_fn)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user