destroy ipset
All checks were successful
Build and Package OPKG / Build for aarch64-3.10 (push) Successful in 53s
Build and Package OPKG / Build for armv5-3.2 (push) Successful in 44s
Build and Package OPKG / Build for armv7-2.6 (push) Successful in 42s
Build and Package OPKG / Build for armv7-3.2 (push) Successful in 41s
Build and Package OPKG / Build for mips-3.4 (push) Successful in 44s
Build and Package OPKG / Build for mipsel-3.4 (push) Successful in 43s

This commit is contained in:
Vladimir Avtsenov 2025-02-14 01:24:52 +03:00
parent fb60f838bc
commit 2371abc9fd
2 changed files with 10 additions and 1 deletions

View File

@ -86,6 +86,15 @@ func (g *Group) Disable() []error {
return errs
}
func (g *Group) Destroy() []error {
errs := g.Disable()
err := g.ipset.Destroy()
if err != nil {
errs = append(errs, err)
}
return errs
}
func (g *Group) Sync(records *records.Records) error {
now := time.Now()

View File

@ -164,7 +164,7 @@ func (a *App) start(ctx context.Context) (err error) {
}
defer func() {
for _, group := range a.Groups {
_ = group.Disable()
_ = group.Destroy()
}
}()