diff --git a/route/router.go b/route/router.go index 642340d4..68f5dc35 100644 --- a/route/router.go +++ b/route/router.go @@ -484,6 +484,13 @@ func (r *Router) Close() error { }) monitor.Finish() } + for i, ruleSet := range r.ruleSets { + monitor.Start("close rule-set[", i, "]") + err = E.Append(err, ruleSet.Close(), func(err error) error { + return E.Cause(err, "close rule-set[", i, "]") + }) + monitor.Finish() + } return err } diff --git a/route/rule/rule_set_local.go b/route/rule/rule_set_local.go index 2b44c50b..4f2fabcc 100644 --- a/route/rule/rule_set_local.go +++ b/route/rule/rule_set_local.go @@ -56,7 +56,7 @@ func NewLocalRuleSet(ctx context.Context, logger logger.Logger, options option.R } } else { filePath := filemanager.BasePath(ctx, options.LocalOptions.Path) - filePath, _ = filepath.Abs(options.LocalOptions.Path) + filePath, _ = filepath.Abs(filePath) err := ruleSet.reloadFile(filePath) if err != nil { return nil, err