소스 검색

[Python] Bump Granian to 1.6 (#9253)

Giovanni Barillari 1 년 전
부모
커밋
ced92062ee
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  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":