Files
DashBoard/gunicorn.conf.py
beabigegg 5b11d0567f feat: WIP 進階篩選功能與資料庫連線穩定性改進
新增功能:
- WORKORDER/LOT ID 模糊搜尋與 autocomplete 下拉選單
- DUMMY lot 預設排除機制 (可透過 include_dummy 參數覆蓋)
- WIP Detail 頁面,支援四種篩選條件組合
- 搜尋 API 端點 GET /api/wip/meta/search

穩定性改進:
- 改用 NullPool 取代連線池,避免長時間閒置連線被防火牆中斷
- 新增 gunicorn worker timeout (60s),防止 worker 卡死
- 前端 fetchWithTimeout 機制,30 秒 API 逾時處理
- 改進 start_server.sh 停止邏輯,處理孤兒 worker 進程

其他:
- Echarts 下載至本地,避免 CDN 追蹤保護警告
- 新增 WIP 篩選功能單元測試
- 更新 MES 核心表分析報告,加入 DWH.DW_PJ_LOT_V 說明

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:48:18 +08:00

12 lines
441 B
Python

import os
bind = os.getenv("GUNICORN_BIND", "0.0.0.0:8080")
workers = int(os.getenv("GUNICORN_WORKERS", "2")) # 2 workers for redundancy
threads = int(os.getenv("GUNICORN_THREADS", "4"))
worker_class = "gthread"
# Timeout settings - critical for dashboard stability
timeout = 60 # Worker timeout: 60 seconds max per request
graceful_timeout = 30 # Graceful shutdown timeout
keepalive = 5 # Keep-alive connections timeout