Browse Source

add nothreading arg to archivebox server for perf profiling

Nick Sweeting 4 years ago
parent
commit
74c882ef16
1 changed files with 6 additions and 1 deletions
  1. 6 1
      archivebox/cli/archivebox_server.py

+ 6 - 1
archivebox/cli/archivebox_server.py

@@ -38,6 +38,11 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
         action='store_true',
         action='store_true',
         help='Enable DEBUG=True mode with more verbose errors',
         help='Enable DEBUG=True mode with more verbose errors',
     )
     )
+    parser.add_argument(
+        '--nothreading',
+        action='store_true',
+        help='Force runserver to run in single-threaded mode',
+    )
     parser.add_argument(
     parser.add_argument(
         '--init',
         '--init',
         action='store_true',
         action='store_true',
@@ -57,7 +62,7 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
     reject_stdin(__command__, stdin)
     reject_stdin(__command__, stdin)
     
     
     server(
     server(
-        runserver_args=command.runserver_args,
+        runserver_args=command.runserver_args + (['--nothreading'] if command.nothreading else []),
         reload=command.reload,
         reload=command.reload,
         debug=command.debug,
         debug=command.debug,
         init=command.init,
         init=command.init,