refactor: queue

This commit is contained in:
tao.chen
2026-08-26 10:55:09 +08:00
parent 8c0e14987e
commit b25a889977
4 changed files with 83 additions and 45 deletions
+3 -1
View File
@@ -27,10 +27,12 @@ func main() {
log.Printf("[%s] %s %d %v", c.Request.Method, c.Request.URL.Path, c.Writer.Status(), time.Since(t))
})
startBuildWorker()
r.POST("/webhook", handleWebhook)
listenAddr := fmt.Sprintf(":%d", *portFlag)
log.Printf("GitLab Webhook 服务已启动 (3 分钟防抖去重)监听端口 %d ...\n", *portFlag)
log.Printf("GitLab Webhook 服务已启动 (队列模式 + 3 分钟冷却去重),监听端口 %d ...\n", *portFlag)
if err := r.Run(listenAddr); err != nil {
log.Fatalf("服务启动失败: %v", err)