diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-07 22:14:51 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-08 04:02:37 +0900 |
| commit | 6bb6071ec1dce0cce59df0cb1c38168918061041 (patch) | |
| tree | feca06471f51ac5a1cdaaed4a0333ee9c0cf38e3 /backend/main.go | |
| parent | 401a28944fc0408811aedadd1c3104e2e2d4d7fe (diff) | |
| download | iosdc-japan-2025-albatross-6bb6071ec1dce0cce59df0cb1c38168918061041.tar.gz iosdc-japan-2025-albatross-6bb6071ec1dce0cce59df0cb1c38168918061041.tar.zst iosdc-japan-2025-albatross-6bb6071ec1dce0cce59df0cb1c38168918061041.zip | |
refactor(backend): move ownership of channel to send task results
Diffstat (limited to 'backend/main.go')
| -rw-r--r-- | backend/main.go | 6 |
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() }() |
