aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-13 15:21:50 +0300
committerGitHub <noreply@github.com>2023-07-13 15:21:50 +0300
commit066d5edf174c06aeb30d705a8a164d3fdfd86fef (patch)
tree0e51f517bb6ac010c0e3dc5937d112656ec9ee9a
parent262ec8ecdaf10d8fe49d0227e24bd3a1459e87b5 (diff)
parentb7c5b30f14aadffadd2d35cb3ecb3e91af00581d (diff)
Merge pull request #11730 from tangjicheng46/master
fix: timeout_keep_alive_handler error
-rw-r--r--modules/api/api.py3
-rw-r--r--modules/cmd_args.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/api/api.py b/modules/api/api.py
index 1804a383..11045292 100644
--- a/modules/api/api.py
+++ b/modules/api/api.py
@@ -719,7 +719,7 @@ class Api:
def launch(self, server_name, port):
self.app.include_router(self.router)
- uvicorn.run(self.app, host=server_name, port=port, timeout_keep_alive=0)
+ uvicorn.run(self.app, host=server_name, port=port, timeout_keep_alive=shared.cmd_opts.timeout_keep_alive)
def kill_webui(self):
restart.stop_program()
@@ -732,3 +732,4 @@ class Api:
def stop_webui(request):
shared.state.server_command = "stop"
return Response("Stopping.")
+
diff --git a/modules/cmd_args.py b/modules/cmd_args.py
index 278a605e..ae78f469 100644
--- a/modules/cmd_args.py
+++ b/modules/cmd_args.py
@@ -106,4 +106,6 @@ parser.add_argument("--skip-version-check", action='store_true', help="Do not ch
parser.add_argument("--no-hashing", action='store_true', help="disable sha256 hashing of checkpoints to help loading performance", default=False)
parser.add_argument("--no-download-sd-model", action='store_true', help="don't download SD1.5 model even if no model is found in --ckpt-dir", default=False)
parser.add_argument('--subpath', type=str, help='customize the subpath for gradio, use with reverse proxy')
+parser.add_argument('--add-stop-route', action='store_true', help='add /_stop route to stop server')
parser.add_argument('--api-server-stop', action='store_true', help='enable server stop/restart/kill via api')
+parser.add_argument('--timeout-keep-alive', type=int, default=30, help='set timeout_keep_alive for uvicorn')