aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-08 19:30:20 +0900
committernsfisis <nsfisis@gmail.com>2024-08-08 19:30:20 +0900
commit9e5500269746d3826382a6dec78f0e82cfda0d42 (patch)
treed8f15d4081132d6cfff3ea3b02f197b2d6bad700 /backend/main.go
parent401a28944fc0408811aedadd1c3104e2e2d4d7fe (diff)
parent113c83b19acc58fbd46e8acdac67ff1a112d0d8c (diff)
downloadiosdc-japan-2024-albatross-9e5500269746d3826382a6dec78f0e82cfda0d42.tar.gz
iosdc-japan-2024-albatross-9e5500269746d3826382a6dec78f0e82cfda0d42.tar.zst
iosdc-japan-2024-albatross-9e5500269746d3826382a6dec78f0e82cfda0d42.zip
Merge branch 'feat/taskqueue'
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/main.go b/backend/main.go
index e3d0052..62499d6 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -61,8 +61,9 @@ func main() {
e.Use(middleware.Recover())
taskQueue := taskqueue.NewQueue("task-db:6379")
+ workerServer := taskqueue.NewWorkerServer("task-db:6379", queries)
- gameHubs := game.NewGameHubs(queries, taskQueue)
+ gameHubs := game.NewGameHubs(queries, taskQueue, workerServer.Results())
err = gameHubs.RestoreFromDB(ctx)
if err != nil {
log.Fatalf("Error restoring game hubs from db %v", err)
@@ -95,9 +96,8 @@ func main() {
return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/logout")
})
- gameHubs.Run()
+ go gameHubs.Run()
- workerServer := taskqueue.NewWorkerServer("task-db:6379", queries, gameHubs.C())
go func() {
workerServer.Run()
}()