mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-09 15:50:01 +00:00
provider: add store_providers cache_file option to gate subscription caching
This commit is contained in:
@@ -51,6 +51,7 @@ type CacheFile struct {
|
||||
storeDNS bool
|
||||
storeWARPConfig bool
|
||||
storeMASQUEConfig bool
|
||||
storeProviders bool
|
||||
disableExpire bool
|
||||
rdrcTimeout time.Duration
|
||||
optimisticTimeout time.Duration
|
||||
@@ -115,6 +116,7 @@ func New(ctx context.Context, logger logger.Logger, options option.CacheFileOpti
|
||||
storeDNS: options.StoreDNS,
|
||||
storeWARPConfig: options.StoreWARPConfig,
|
||||
storeMASQUEConfig: options.StoreMASQUEConfig,
|
||||
storeProviders: options.StoreProviders,
|
||||
rdrcTimeout: rdrcTimeout,
|
||||
saveDomain: make(map[netip.Addr]string),
|
||||
saveAddress4: make(map[string]netip.Addr),
|
||||
@@ -485,6 +487,10 @@ func (c *CacheFile) StoreMASQUEConfig() bool {
|
||||
return c.storeMASQUEConfig
|
||||
}
|
||||
|
||||
func (c *CacheFile) StoreProviders() bool {
|
||||
return c.storeProviders
|
||||
}
|
||||
|
||||
func (c *CacheFile) LoadWARPConfig(tag string) *adapter.SavedBinary {
|
||||
var savedConfig adapter.SavedBinary
|
||||
err := c.DB.View(func(t *bbolt.Tx) error {
|
||||
|
||||
Reference in New Issue
Block a user