mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-22 16:58:54 +02:00
replace unnecessary Task interface with struct
This commit is contained in:
@@ -28,7 +28,7 @@ func (p *Provider) newEventHandler() *EventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
func (handler *EventHandler) Handle(parent task.Task, events []watcher.Event) {
|
||||
func (handler *EventHandler) Handle(parent *task.Task, events []watcher.Event) {
|
||||
oldRoutes := handler.provider.routes
|
||||
newRoutes, err := handler.provider.loadRoutesImpl()
|
||||
if err != nil {
|
||||
@@ -97,7 +97,7 @@ func (handler *EventHandler) match(event watcher.Event, route *route.Route) bool
|
||||
return false
|
||||
}
|
||||
|
||||
func (handler *EventHandler) Add(parent task.Task, route *route.Route) {
|
||||
func (handler *EventHandler) Add(parent *task.Task, route *route.Route) {
|
||||
err := handler.provider.startRoute(parent, route)
|
||||
if err != nil {
|
||||
handler.errs.Add(err.Subject("add"))
|
||||
@@ -112,7 +112,7 @@ func (handler *EventHandler) Remove(route *route.Route) {
|
||||
handler.removed.Adds(route.Entry.Alias)
|
||||
}
|
||||
|
||||
func (handler *EventHandler) Update(parent task.Task, oldRoute *route.Route, newRoute *route.Route) {
|
||||
func (handler *EventHandler) Update(parent *task.Task, oldRoute *route.Route, newRoute *route.Route) {
|
||||
oldRoute.Finish("route update")
|
||||
err := handler.provider.startRoute(parent, newRoute)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user