aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/taskqueue/worker_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/taskqueue/worker_server.go')
-rw-r--r--backend/taskqueue/worker_server.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/taskqueue/worker_server.go b/backend/taskqueue/worker_server.go
index 9bdd81f..09d9761 100644
--- a/backend/taskqueue/worker_server.go
+++ b/backend/taskqueue/worker_server.go
@@ -2,13 +2,16 @@ package taskqueue
import (
"github.com/hibiken/asynq"
+
+ "github.com/nsfisis/iosdc-japan-2024-albatross/backend/db"
)
type WorkerServer struct {
- server *asynq.Server
+ server *asynq.Server
+ queries *db.Queries
}
-func NewWorkerServer(redisAddr string) *WorkerServer {
+func NewWorkerServer(redisAddr string, queries *db.Queries) *WorkerServer {
return &WorkerServer{
server: asynq.NewServer(
asynq.RedisClientOpt{
@@ -21,7 +24,7 @@ func NewWorkerServer(redisAddr string) *WorkerServer {
func (s *WorkerServer) Run() error {
mux := asynq.NewServeMux()
- mux.Handle(TaskTypeExec, NewExecProcessor())
+ mux.Handle(TaskTypeExec, NewExecProcessor(s.queries))
return s.server.Run(mux)
}