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 {
|
||||
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 {
|
||||
p.Publisher.OnDispose(func() {
|
||||
if p.Publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, task.ErrStopByUser) || p.MaxRetry == 0 {
|
||||
p.Stop(p.Publisher.StopReason())
|
||||
p.Publisher = publisher
|
||||
publisher.OnDispose(func() {
|
||||
if publisher.StopReasonIs(pkg.ErrPublishDelayCloseTimeout, task.ErrStopByUser) || p.MaxRetry == 0 {
|
||||
p.Stop(publisher.StopReason())
|
||||
} else {
|
||||
p.puller.Stop(p.Publisher.StopReason())
|
||||
p.puller.Stop(publisher.StopReason())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user