fix deadlock

This commit is contained in:
Niko Storni 2021-06-17 22:02:42 +02:00
parent 7c652b22a1
commit 768743a200
2 changed files with 1 additions and 2 deletions

View file

@ -132,7 +132,6 @@ func (s *Sync) FullCycle() (e error) {
log.Println("Got interrupt signal, shutting down (if publishing, will shut down after current publish)") log.Println("Got interrupt signal, shutting down (if publishing, will shut down after current publish)")
s.grp.Stop() s.grp.Stop()
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
debug.PrintStack() // so we can figure out what's not stopping
}() }()
err := s.setStatusSyncing() err := s.setStatusSyncing()
if err != nil { if err != nil {

View file

@ -339,7 +339,7 @@ func (v *YoutubeVideo) download() error {
return errors.Err(err) return errors.Err(err)
} }
ticker := time.NewTicker(400 * time.Millisecond) ticker := time.NewTicker(400 * time.Millisecond)
done := make(chan bool) done := make(chan bool, 1)
v.progressBarWg.Add(1) v.progressBarWg.Add(1)
go func() { go func() {
defer v.progressBarWg.Done() defer v.progressBarWg.Done()