From 59471f9c265e8b9ecbdba2b8c0db5650804b3a1e Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 27 Dec 2019 01:27:29 +0100 Subject: [PATCH] reduce sync delay fix stopper bug --- manager/manager.go | 2 +- manager/ytsync.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manager/manager.go b/manager/manager.go index 35026b9..2215ae2 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -161,7 +161,7 @@ func (s *SyncManager) Start() error { for _, q := range queuesToSync { //temporary override for sync-until to give tom the time to review the channels if q == StatusQueued { - s.syncProperties.SyncUntil = time.Now().AddDate(0, 0, -1).Unix() + s.syncProperties.SyncUntil = time.Now().Add(-8 * time.Hour).Unix() } channels, err := s.apiConfig.FetchChannels(q, s.syncProperties) if err != nil { diff --git a/manager/ytsync.go b/manager/ytsync.go index 53de4e8..f79a66a 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -246,6 +246,8 @@ func (s *Sync) setExceptions() { } } +var stopGroup = stop.New() + func (s *Sync) FullCycle() (e error) { if os.Getenv("HOME") == "" { return errors.Err("no $HOME env var found") @@ -258,7 +260,7 @@ func (s *Sync) FullCycle() (e error) { s.syncedVideosMux = &sync.RWMutex{} s.walletMux = &sync.RWMutex{} - s.grp = stop.New() + s.grp = stopGroup s.queue = make(chan video) interruptChan := make(chan os.Signal, 1) signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM)