mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-23 19:30:09 +08:00
chore: modify initial resource update
This commit is contained in:
parent
5c1404f78e
commit
5858384631
@ -13,10 +13,6 @@ import (
|
|||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
minInterval = time.Minute * 5
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
fileMode os.FileMode = 0o666
|
fileMode os.FileMode = 0o666
|
||||||
dirMode os.FileMode = 0o755
|
dirMode os.FileMode = 0o755
|
||||||
@ -164,8 +160,8 @@ func (f *Fetcher[V]) Destroy() error {
|
|||||||
|
|
||||||
func (f *Fetcher[V]) pullLoop() {
|
func (f *Fetcher[V]) pullLoop() {
|
||||||
initialInterval := f.interval - time.Since(f.UpdatedAt)
|
initialInterval := f.interval - time.Since(f.UpdatedAt)
|
||||||
if initialInterval < minInterval {
|
if initialInterval > f.interval {
|
||||||
initialInterval = minInterval
|
initialInterval = f.interval
|
||||||
}
|
}
|
||||||
|
|
||||||
timer := time.NewTimer(initialInterval)
|
timer := time.NewTimer(initialInterval)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user