mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-02 09:52: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),
|
||||
providerEventFlushInterval,
|
||||
func(events []events.Event) {
|
||||
routesTask.FinishAndWait("reload routes")
|
||||
routesTask = t.Subtask("routes", false)
|
||||
handler := p.newEventHandler()
|
||||
// routes' lifetime should follow the provider's lifetime
|
||||
handler.Handle(routesTask, events)
|
||||
|
|
|
@ -227,7 +227,7 @@ func (r *Route) Finish(reason any) {
|
|||
if r.impl == nil {
|
||||
return
|
||||
}
|
||||
r.impl.Finish(reason)
|
||||
r.impl.Task().FinishAndWait(reason)
|
||||
r.impl = nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue