mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-08-30 13:21:49 +00:00
route: Refetch rule-set when cache restore fails
This commit is contained in:
parent
b8ef5b2ad1
commit
8196cc7644
1 changed files with 4 additions and 3 deletions
|
|
@ -89,10 +89,11 @@ func (s *RemoteRuleSet) StartContext(ctx context.Context, startContext *adapter.
|
|||
if savedSet := s.cacheFile.LoadRuleSet(s.options.Tag); savedSet != nil {
|
||||
err = s.loadBytes(savedSet.Content)
|
||||
if err != nil {
|
||||
return E.Cause(err, "restore cached rule-set")
|
||||
s.logger.Warn(E.Cause(err, "restore cached rule-set, will refetch"))
|
||||
} else {
|
||||
s.lastUpdated = savedSet.LastUpdated
|
||||
s.lastEtag = savedSet.LastEtag
|
||||
}
|
||||
s.lastUpdated = savedSet.LastUpdated
|
||||
s.lastEtag = savedSet.LastEtag
|
||||
}
|
||||
}
|
||||
if s.lastUpdated.IsZero() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue