refactor(config): reduce references to config.GetInstance()

This commit is contained in:
yusing
2025-10-07 21:49:00 +08:00
parent 584db2efce
commit a150f1a628
8 changed files with 36 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package acl
import (
"net"
"sync/atomic"
"time"
"github.com/puzpuzpuz/xsync/v4"
@@ -39,6 +40,9 @@ type checkCache struct {
created time.Time
}
// could be nil
var ActiveConfig atomic.Pointer[Config]
const cacheTTL = 1 * time.Minute
func (c *checkCache) Expired() bool {