mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-26 23:05:55 +08:00
fix: pull job publisher panic
This commit is contained in:
12
puller.go
12
puller.go
@@ -239,13 +239,15 @@ func (p *PullJob) Publish() (err error) {
|
|||||||
if len(p.Connection.Args) > 0 {
|
if len(p.Connection.Args) > 0 {
|
||||||
streamPath += "?" + p.Connection.Args.Encode()
|
streamPath += "?" + p.Connection.Args.Encode()
|
||||||
}
|
}
|
||||||
p.Publisher, err = p.Plugin.PublishWithConfig(p.puller, streamPath, p.PublishConfig)
|
var publisher *Publisher
|
||||||
|
publisher, err = p.Plugin.PublishWithConfig(p.puller, streamPath, p.PublishConfig)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
p.Publisher.OnDispose(func() {
|
p.Publisher = publisher
|
||||||
if p.Publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, task.ErrStopByUser) || p.MaxRetry == 0 {
|
publisher.OnDispose(func() {
|
||||||
p.Stop(p.Publisher.StopReason())
|
if publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, task.ErrStopByUser) || p.MaxRetry == 0 {
|
||||||
|
p.Stop(publisher.StopReason())
|
||||||
} else {
|
} else {
|
||||||
p.puller.Stop(p.Publisher.StopReason())
|
p.puller.Stop(publisher.StopReason())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user