mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-08 09:32:06 +08:00
Fix rule-set not closed
This commit is contained in:
parent
27c31eac5d
commit
9b4c11ba95
@ -484,6 +484,13 @@ func (r *Router) Close() error {
|
|||||||
})
|
})
|
||||||
monitor.Finish()
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ func NewLocalRuleSet(ctx context.Context, logger logger.Logger, options option.R
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
filePath := filemanager.BasePath(ctx, options.LocalOptions.Path)
|
filePath := filemanager.BasePath(ctx, options.LocalOptions.Path)
|
||||||
filePath, _ = filepath.Abs(options.LocalOptions.Path)
|
filePath, _ = filepath.Abs(filePath)
|
||||||
err := ruleSet.reloadFile(filePath)
|
err := ruleSet.reloadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user