improved pre-caching unloading

master
cheetah 1 year ago
parent db196779e8
commit 1ced402ce0

@ -797,7 +797,7 @@ func (p *PoolMaster) CleanWORMTemp() (err error) {
if time.Since(wormPool.LastTouchy).Minutes() > 4 { if time.Since(wormPool.LastTouchy).Minutes() > 4 {
wormPool.Unload() wormPool.Unload()
delete(p.WORMPools, wormPool.PoolID) delete(p.WORMPools, wormPool.PoolID)
os.RemoveAll(filepath.Join(poolMaster.cachePath, "worm", wormPool.PoolID)) //os.RemoveAll(filepath.Join(poolMaster.cachePath, "worm", wormPool.PoolID))
} }
} }
return nil return nil
@ -990,7 +990,6 @@ func (p *PoolMaster) Fetch(id string, writer io.Writer) (err error) {
} }
// fastCachePool // fastCachePool
p.WORMPools[fastCachePool.PoolID] = fastCachePool p.WORMPools[fastCachePool.PoolID] = fastCachePool
} }
return nil return nil
} }
@ -1096,7 +1095,7 @@ func main() {
go func() { go func() {
for { for {
poolMaster.PackFullPools() poolMaster.PackFullPools()
//poolMaster.CleanWORMTemp() poolMaster.CleanWORMTemp()
time.Sleep(time.Minute * 2) time.Sleep(time.Minute * 2)
} }
}() }()

Loading…
Cancel
Save