Skip to content

Commit d3e3ace

Browse files
committed
[python] FastPySGI: Fix bugs and using uvloop
1 parent 01dfa0e commit d3e3ace

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

frameworks/fastpysgi-asgi/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ async def app(scope, receive, send):
293293
# -----------------------------------------------------------------------
294294

295295
if __name__ == "__main__":
296+
import uvloop
296297
import fastpysgi
297298

298299
certfile = os.environ.get("TLS_CERT", "/certs/server.crt")
@@ -305,5 +306,7 @@ async def app(scope, receive, send):
305306
fastpysgi.server.read_buffer_size = 256*1024
306307
fastpysgi.server.max_content_length = 31_000_000
307308
fastpysgi.server.backlog = 16*1024
308-
fastpysgi.server.loop_timeout = 1000
309+
fastpysgi.server.loop = uvloop.new_event_loop()
310+
fastpysgi.server.loop_timeout = 300
311+
fastpysgi.server.loop_call_soon = 0
309312
fastpysgi.run(app, workers = WRK_COUNT, loglevel = 0)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#fastpysgi==0.7
2-
git+https://github.com/remittor/fastpysgi.git@4b4268517a503f51d9e90ecf8a9e47bff79b491f#egg=fastpysgi
2+
git+https://github.com/remittor/fastpysgi.git@04def3a9dcbd7c4038a286d880e79ce2fc2b5b55#egg=fastpysgi
3+
uvloop==0.22.1
34
orjson==3.11.8
45
asyncpg==0.31.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#fastpysgi==0.7
2-
git+https://github.com/remittor/fastpysgi.git@4b4268517a503f51d9e90ecf8a9e47bff79b491f#egg=fastpysgi
2+
git+https://github.com/remittor/fastpysgi.git@131a3dfce3204db1dd7ada6e43c2c2c41c4fef34#egg=fastpysgi
33
orjson==3.10.15
44
psycopg[binary]==3.2.4
55
psycopg_pool==3.2.6

0 commit comments

Comments
 (0)