feat: add graceful api shutdown readiness

This commit is contained in:
2026-06-05 11:43:56 +08:00
parent 9ab353926e
commit e5592304a5
19 changed files with 321 additions and 35 deletions

View File

@@ -190,7 +190,7 @@ http {
proxy_set_header X-Request-Id $request_id;
}
location ~ ^/(generated-|healthz) {
location ~ ^/(generated-|healthz|readyz) {
return 404;
}

View File

@@ -11,6 +11,7 @@ GENARRATIVE_API_MAX_CONCURRENT_REQUESTS=512
GENARRATIVE_API_GALLERY_MAX_CONCURRENT_REQUESTS=320
GENARRATIVE_API_DETAIL_MAX_CONCURRENT_REQUESTS=64
GENARRATIVE_API_ADMIN_MAX_CONCURRENT_REQUESTS=16
GENARRATIVE_API_SHUTDOWN_OUTBOX_FLUSH_TIMEOUT_MS=5000
GENARRATIVE_TRACKING_OUTBOX_ENABLED=true
GENARRATIVE_TRACKING_OUTBOX_DIR=/var/lib/genarrative/tracking-outbox
GENARRATIVE_TRACKING_OUTBOX_BATCH_SIZE=500

View File

@@ -215,7 +215,7 @@ server {
}
# 开发服仍不恢复旧生成资源代理和健康检查公网入口。
location ~ ^/(generated-|healthz) {
location ~ ^/(generated-|healthz|readyz) {
return 404;
}

View File

@@ -235,7 +235,7 @@ server {
}
# 生产公网不再暴露旧生成资源代理和健康检查入口。
location ~ ^/(generated-|healthz) {
location ~ ^/(generated-|healthz|readyz) {
return 404;
}

View File

@@ -14,7 +14,7 @@ ExecStart=/opt/genarrative/current/api-server
Restart=always
RestartSec=5
KillSignal=SIGINT
TimeoutStopSec=30
TimeoutStopSec=90
LimitNOFILE=65535
TasksMax=2048