diff --git a/.github/workflows/prod-deploy-asynqmon.yml b/.github/workflows/prod-deploy-asynqmon.yml index 8466d69f..70dcf4bd 100644 --- a/.github/workflows/prod-deploy-asynqmon.yml +++ b/.github/workflows/prod-deploy-asynqmon.yml @@ -22,8 +22,8 @@ jobs: script: | cd /root/core/infra git fetch - git checkout dev - git reset --hard origin/dev + git checkout master + git reset --hard origin/master git pull docker compose -f docker-compose.api.yml pull asynqmon diff --git a/apps/api/cmd/BAT_worker/main.go b/apps/api/cmd/BAT_worker/main.go index e6f71ae6..79cff8a0 100644 --- a/apps/api/cmd/BAT_worker/main.go +++ b/apps/api/cmd/BAT_worker/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "time" "github.com/hibiken/asynq" @@ -57,6 +58,7 @@ func main() { ) logger.Info().Msg("Debug test") + fmt.Print("Debug test") schedulerLocation, err := time.LoadLocation("America/New_York") if err != nil { @@ -69,6 +71,9 @@ func main() { }, ) + logger.Info().Msg("Debug test") + fmt.Print("Debug test") + taskQueueClient := asynq.NewClient(redisOpt) database := db.NewDB(cfg.DatabaseURL) diff --git a/apps/api/internal/workers/bat.go b/apps/api/internal/workers/bat.go index 4b954738..90cdcf76 100644 --- a/apps/api/internal/workers/bat.go +++ b/apps/api/internal/workers/bat.go @@ -79,14 +79,15 @@ func (w *BATWorker) HandleScheduleTransitionWaitlistTask(ctx context.Context, t MaxAcceptedApplications: cfg.MaxAcceptedApplications, }) - w.scheduler.Start() // The scheduler will make its first run after the period cycles once. So we queue our task immediately as well. + _, err = w.taskQueue.Enqueue(task, asynq.Queue("bat")) + + w.scheduler.Start() _, err = w.scheduler.Register(payload.Period, task, asynq.Queue("bat")) if err != nil { w.logger.Err(err) return nil } - _, err = w.taskQueue.Enqueue(task, asynq.Queue("bat")) return nil }