From 607a79f40a9a7d693e20c5eaa2ba5cf8dc742874 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Thu, 24 May 2018 12:59:34 -0400 Subject: [PATCH] update stoponce --- ytsync.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ytsync.go b/ytsync.go index a95e64a..2117efd 100644 --- a/ytsync.go +++ b/ytsync.go @@ -22,7 +22,6 @@ import ( "github.com/lbryio/lbry.go/ytsync/redisdb" "github.com/lbryio/lbry.go/ytsync/sources" - "github.com/mitchellh/go-ps" log "github.com/sirupsen/logrus" "google.golang.org/api/googleapi/transport" "google.golang.org/api/youtube/v3" @@ -152,7 +151,7 @@ func (s *Sync) FullCycle() error { WaitForDaemonStart: for { select { - case <-s.stop.Chan(): + case <-s.stop.Ch(): return nil default: _, err := s.daemon.WalletBalance() @@ -211,7 +210,7 @@ func (s *Sync) startWorker(workerNum int) { for { select { - case <-s.stop.Chan(): + case <-s.stop.Ch(): log.Printf("Stopping worker %d", workerNum) return default: @@ -222,7 +221,7 @@ func (s *Sync) startWorker(workerNum int) { if !more { return } - case <-s.stop.Chan(): + case <-s.stop.Ch(): log.Printf("Stopping worker %d", workerNum) return } @@ -333,14 +332,14 @@ func (s *Sync) enqueueYoutubeVideos() error { Enqueue: for _, v := range videos { select { - case <-s.stop.Chan(): + case <-s.stop.Ch(): break Enqueue default: } select { case s.queue <- v: - case <-s.stop.Chan(): + case <-s.stop.Ch(): break Enqueue } } @@ -382,14 +381,14 @@ func (s *Sync) enqueueUCBVideos() error { Enqueue: for _, v := range videos { select { - case <-s.stop.Chan(): + case <-s.stop.Ch(): break Enqueue default: } select { case s.queue <- v: - case <-s.stop.Chan(): + case <-s.stop.Ch(): break Enqueue } }