()
| 148 | } |
| 149 | |
| 150 | func (this *OpenFileCache) CloseAll() { |
| 151 | this.locker.Lock() |
| 152 | for _, pool := range this.poolMap { |
| 153 | pool.Close() |
| 154 | } |
| 155 | this.poolMap = map[string]*OpenFilePool{} |
| 156 | this.poolList.Reset() |
| 157 | _ = this.watcher.Close() |
| 158 | this.count = 0 |
| 159 | this.usedSize = 0 |
| 160 | this.locker.Unlock() |
| 161 | } |
| 162 | |
| 163 | func (this *OpenFileCache) SetCapacity(capacityBytes int64) { |
| 164 | this.capacitySize = capacityBytes |