Compare commits

...
2 Commits
Author SHA1 Message Date
Niko Storni 768743a200 fix deadlock 2021-06-17 22:02:42 +02:00
Niko Storni 7c652b22a1 better output 2021-06-17 19:43:30 +02:00
2 changed files with 7 additions and 3 deletions

No files matched your search

-1
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)")
s.grp.Stop()
time.Sleep(5 * time.Second)
debug.PrintStack() // so we can figure out what's not stopping
}()
err := s.setStatusSyncing()
if err != nil {
+7 -2
View File
@@ -339,7 +339,7 @@ func (v *YoutubeVideo) download() error {
return errors.Err(err)
}
ticker := time.NewTicker(400 * time.Millisecond)
done := make(chan bool)
done := make(chan bool, 1)
v.progressBarWg.Add(1)
go func() {
defer v.progressBarWg.Done()
@@ -395,7 +395,12 @@ func (v *YoutubeVideo) download() error {
decor.EwmaETA(decor.ET_STYLE_GO, 90),
decor.Name(" ] "),
decor.EwmaSpeed(decor.UnitKiB, "% .2f ", 60),
decor.OnComplete(
// ETA decorator with ewma age of 60
decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
),
),
mpb.BarRemoveOnComplete(),
)
for {
@@ -737,7 +742,7 @@ func (v *YoutubeVideo) downloadAndPublish(daemon *jsonrpc.Client, params SyncPar
break
}
log.Debugln("Downloaded " + v.id)
//log.Debugln("Downloaded " + v.id)
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()