Commit c31f442a authored by acud's avatar acud Committed by GitHub

fix(pusher): dont increment missing tags (#2081)

parent 3eae0187
...@@ -206,22 +206,27 @@ LOOP: ...@@ -206,22 +206,27 @@ LOOP:
err = fmt.Errorf("pusher: set sync: %w", err) err = fmt.Errorf("pusher: set sync: %w", err)
return return
} }
if ch.TagID() > 0 {
t, err = s.tag.Get(ch.TagID()) // for individual chunks uploaded using the
if err == nil && t != nil { // /chunks api endpoint the tag will be missing
err = t.Inc(tags.StateSynced) // by default, unless the api consumer specifies one
if err != nil { t, err = s.tag.Get(ch.TagID())
err = fmt.Errorf("pusher: increment synced: %v", err) if err == nil && t != nil {
return err = t.Inc(tags.StateSynced)
}
if wantSelf {
err = t.Inc(tags.StateSent)
if err != nil { if err != nil {
err = fmt.Errorf("pusher: increment sent: %w", err) err = fmt.Errorf("pusher: increment synced: %v", err)
return return
} }
if wantSelf {
err = t.Inc(tags.StateSent)
if err != nil {
err = fmt.Errorf("pusher: increment sent: %w", err)
return
}
}
} }
} }
}(ctx, ch) }(ctx, ch)
case <-timer.C: case <-timer.C:
// initially timer is set to go off as well as every time we hit the end of push index // initially timer is set to go off as well as every time we hit the end of push index
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment