reduce sync delay

fix stopper bug
This commit is contained in:
Niko Storni 2019-12-27 01:27:29 +01:00
parent 8028c6621c
commit 59471f9c26
2 changed files with 4 additions and 2 deletions

View file

@ -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 {

View file

@ -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)