mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-04 02:42:34 +02:00
fix(routes): accidentally finished all routes when one route changed
This commit is contained in:
parent
371e756307
commit
ed07bf42ce
2 changed files with 1 additions and 3 deletions
|
@ -110,8 +110,6 @@ func (p *Provider) Start(parent task.Parent) gperr.Error {
|
||||||
t.Subtask("event_queue", false),
|
t.Subtask("event_queue", false),
|
||||||
providerEventFlushInterval,
|
providerEventFlushInterval,
|
||||||
func(events []events.Event) {
|
func(events []events.Event) {
|
||||||
routesTask.FinishAndWait("reload routes")
|
|
||||||
routesTask = t.Subtask("routes", false)
|
|
||||||
handler := p.newEventHandler()
|
handler := p.newEventHandler()
|
||||||
// routes' lifetime should follow the provider's lifetime
|
// routes' lifetime should follow the provider's lifetime
|
||||||
handler.Handle(routesTask, events)
|
handler.Handle(routesTask, events)
|
||||||
|
|
|
@ -227,7 +227,7 @@ func (r *Route) Finish(reason any) {
|
||||||
if r.impl == nil {
|
if r.impl == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r.impl.Finish(reason)
|
r.impl.Task().FinishAndWait(reason)
|
||||||
r.impl = nil
|
r.impl = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue