Stop 停止
()
| 939 | |
| 940 | // Stop 停止 |
| 941 | func (this *FileStorage) Stop() { |
| 942 | events.Remove(this) |
| 943 | |
| 944 | this.locker.Lock() |
| 945 | defer this.locker.Unlock() |
| 946 | |
| 947 | // 先尝试内存缓存 |
| 948 | this.runMemoryStorageSafety(func(memoryStorage *MemoryStorage) { |
| 949 | memoryStorage.Stop() |
| 950 | }) |
| 951 | |
| 952 | if this.list != nil { |
| 953 | _ = this.list.Reset() |
| 954 | } |
| 955 | |
| 956 | if this.purgeTicker != nil { |
| 957 | this.purgeTicker.Stop() |
| 958 | } |
| 959 | if this.hotTicker != nil { |
| 960 | this.hotTicker.Stop() |
| 961 | } |
| 962 | |
| 963 | if this.list != nil { |
| 964 | _ = this.list.Close() |
| 965 | } |
| 966 | |
| 967 | var openFileCache = this.openFileCache |
| 968 | if openFileCache != nil { |
| 969 | openFileCache.CloseAll() |
| 970 | } |
| 971 | |
| 972 | this.ignoreKeys.Reset() |
| 973 | } |
| 974 | |
| 975 | // TotalDiskSize 消耗的磁盘尺寸 |
| 976 | func (this *FileStorage) TotalDiskSize() int64 { |