aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-20 22:19:42 +0900
committernsfisis <nsfisis@gmail.com>2026-02-20 22:19:42 +0900
commit08ae228c45745372784017fe694d61d9ed0e2981 (patch)
treed42b6429460b66a7dc6604759b43f940dace1b62 /backend/main.go
parent26ead17e4c3682a93f64cca646b291b7ce6b195d (diff)
downloadphperkaigi-2026-albatross-08ae228c45745372784017fe694d61d9ed0e2981.tar.gz
phperkaigi-2026-albatross-08ae228c45745372784017fe694d61d9ed0e2981.tar.zst
phperkaigi-2026-albatross-08ae228c45745372784017fe694d61d9ed0e2981.zip
feat(admin): integrate asynqmon web UI for task queue monitoring
Mount asynqmon HTTP handler under admin/queue with existing session cookie and admin middleware authentication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/main.go b/backend/main.go
index e74a62f..2825b84 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -8,6 +8,8 @@ import (
"os"
"time"
+ "github.com/hibiken/asynq"
+ "github.com/hibiken/asynqmon"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
@@ -111,6 +113,13 @@ func main() {
adminGroup.Use(api.SessionCookieMiddleware(queries))
adminHandler.RegisterHandlers(adminGroup)
+ queueMonitor := asynqmon.New(asynqmon.Options{
+ RootPath: conf.BasePath + "admin/queue",
+ RedisConnOpt: asynq.RedisClientOpt{Addr: "task-db:6379"},
+ })
+ adminGroup.Any("/queue/*", echo.WrapHandler(queueMonitor))
+ adminGroup.Any("/queue", echo.WrapHandler(queueMonitor))
+
if conf.IsLocal {
filesGroup := e.Group(conf.BasePath + "files")
filesGroup.Use(middleware.StaticWithConfig(middleware.StaticConfig{