Browse Source

[Python] Bump Granian to 1.6 (#9253)

Giovanni Barillari 11 months ago
parent
commit
ced92062ee
2 changed files with 5 additions and 3 deletions
  1. 1 1
      frameworks/Python/granian/requirements.txt
  2. 4 2
      frameworks/Python/granian/run.py

+ 1 - 1
frameworks/Python/granian/requirements.txt

@@ -1,4 +1,4 @@
 asyncpg==0.29.0
-granian>=1.5.1,<1.6.0
+granian>=1.6.0,<1.7.0
 jinja2==3.1.4
 orjson==3.10.2

+ 4 - 2
frameworks/Python/granian/run.py

@@ -7,9 +7,11 @@ from granian import Granian
 if __name__ == '__main__':
     interface = sys.argv[1]
     threading_mode = sys.argv[2]
+    workers = multiprocessing.cpu_count()
 
-    #: split cores between the two loops
-    workers = round(multiprocessing.cpu_count() / 2)
+    if interface == "rsgi":
+        #: split cores between the two loops
+        workers = round(workers / 2)
 
     blocking_threads = None
     if interface == "wsgi":