fix(routes): accidentally finished all routes when one route changed

This commit is contained in:
yusing 2025-05-29 19:22:42 +08:00
parent 371e756307
commit ed07bf42ce
2 changed files with 1 additions and 3 deletions

View file

@ -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)

View file

@ -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
}