fix: writeTrailerTask never dispose

This commit is contained in:
langhuihui
2024-11-10 15:58:41 +08:00
parent e0f4d79d75
commit 70a34010c9
10 changed files with 860 additions and 763 deletions

View File

@@ -128,8 +128,10 @@ func (p *PullJob) Publish() (err error) {
p.Publisher.Type = PublishTypePull
if err == nil && p.conf.MaxRetry != 0 {
p.Publisher.OnDispose(func() {
if p.Publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, pkg.ErrStopFromAPI) {
if p.Publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, task.ErrStopByUser) {
p.Stop(p.Publisher.StopReason())
} else {
p.puller.Stop(p.Publisher.StopReason())
}
})
}