| 165 | } |
| 166 | |
| 167 | func (this *OpenFileCache) Debug() { |
| 168 | var ticker = time.NewTicker(5 * time.Second) |
| 169 | goman.New(func() { |
| 170 | for range ticker.C { |
| 171 | logs.Println("==== " + types.String(this.count) + ", " + fmt.Sprintf("%.4fMB", float64(this.usedSize)/(1<<20)) + " ====") |
| 172 | this.poolList.Range(func(item *linkedlist.Item[*OpenFilePool]) (goNext bool) { |
| 173 | logs.Println(filepath.Base(item.Value.Filename()), item.Value.Len()) |
| 174 | return true |
| 175 | }) |
| 176 | } |
| 177 | }) |
| 178 | } |
| 179 | |
| 180 | func (this *OpenFileCache) consumeHead() { |
| 181 | var delta = 1 |