From 35cad5d66e771e6c79d38cf13757f4c28aa7b78a Mon Sep 17 00:00:00 2001 From: Zibbp Date: Sun, 24 Dec 2023 22:55:14 +0000 Subject: [PATCH] feat(scheduler): remove old queue schedule --- internal/scheduler/scheduler.go | 20 -------------------- internal/transport/http/handler.go | 1 - internal/transport/http/scheduler.go | 1 - 3 files changed, 22 deletions(-) diff --git a/internal/scheduler/scheduler.go b/internal/scheduler/scheduler.go index df0d514d..37f824b4 100644 --- a/internal/scheduler/scheduler.go +++ b/internal/scheduler/scheduler.go @@ -60,15 +60,6 @@ func (s *Service) StartWatchVideoScheduler() { scheduler.StartAsync() } -func (s *Service) StartQueueItemScheduler() { - time.Sleep(time.Second * 5) - scheduler := gocron.NewScheduler(time.UTC) - - s.checkHeldQueueItems(scheduler) - - scheduler.StartAsync() -} - func (s *Service) StartJwksScheduler() { time.Sleep(time.Second * 5) scheduler := gocron.NewScheduler(time.UTC) @@ -151,17 +142,6 @@ func (s *Service) checkWatchedChannelVideos(schedule *gocron.Scheduler) { } } -func (s *Service) checkHeldQueueItems(scheduler *gocron.Scheduler) { - log.Debug().Msg("setting up queue item schedule") - _, err := scheduler.Every(1).Hours().Do(func() { - log.Debug().Msg("running queue item schedule") - go s.ArchiveService.CheckOnHold() - }) - if err != nil { - log.Error().Err(err).Msg("failed to set up queue item schedule") - } -} - func (s *Service) fetchJwksSchedule(scheduler *gocron.Scheduler) { log.Debug().Msg("setting up fetch jwks schedule") _, err := scheduler.Every(1).Days().Do(func() { diff --git a/internal/transport/http/handler.go b/internal/transport/http/handler.go index 23c2e02d..9efdae77 100644 --- a/internal/transport/http/handler.go +++ b/internal/transport/http/handler.go @@ -86,7 +86,6 @@ func NewHandler(authService AuthService, channelService ChannelService, vodServi // to avoid blocking application start // and to wait for twitch api auth go h.Service.SchedulerService.StartLiveScheduler() - go h.Service.SchedulerService.StartQueueItemScheduler() if viper.GetBool("oauth_enabled") { go h.Service.SchedulerService.StartJwksScheduler() } diff --git a/internal/transport/http/scheduler.go b/internal/transport/http/scheduler.go index a1079512..2e1f03f6 100644 --- a/internal/transport/http/scheduler.go +++ b/internal/transport/http/scheduler.go @@ -3,7 +3,6 @@ package http type SchedulerService interface { StartAppScheduler() StartLiveScheduler() - StartQueueItemScheduler() StartJwksScheduler() StartWatchVideoScheduler() StartTwitchCategoriesScheduler()