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.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/taskqueue/worker_server.go b/backend/taskqueue/worker_server.go
index 09d9761..485d6d3 100644
--- a/backend/taskqueue/worker_server.go
+++ b/backend/taskqueue/worker_server.go
@@ -9,9 +9,10 @@ import (
type WorkerServer struct {
server *asynq.Server
queries *db.Queries
+ c chan string
}
-func NewWorkerServer(redisAddr string, queries *db.Queries) *WorkerServer {
+func NewWorkerServer(redisAddr string, queries *db.Queries, c chan string) *WorkerServer {
return &WorkerServer{
server: asynq.NewServer(
asynq.RedisClientOpt{
@@ -19,12 +20,14 @@ func NewWorkerServer(redisAddr string, queries *db.Queries) *WorkerServer {
},
asynq.Config{},
),
+ queries: queries,
+ c: c,
}
}
func (s *WorkerServer) Run() error {
mux := asynq.NewServeMux()
- mux.Handle(TaskTypeExec, NewExecProcessor(s.queries))
+ mux.Handle(TaskTypeExec, NewExecProcessor(s.queries, s.c))
return s.server.Run(mux)
}