mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-24 16:00:24 +08:00
优化索引数据库关闭速度
This commit is contained in:
@@ -406,11 +406,16 @@ func (this *SQLiteFileList) OnRemove(f func(item *Item)) {
|
||||
func (this *SQLiteFileList) Close() error {
|
||||
this.memoryCache.Destroy()
|
||||
|
||||
var group = goman.NewTaskGroup()
|
||||
for _, db := range this.dbList {
|
||||
if db != nil {
|
||||
_ = db.Close()
|
||||
}
|
||||
var dbCopy = db
|
||||
group.Run(func() {
|
||||
if dbCopy != nil {
|
||||
_ = dbCopy.Close()
|
||||
}
|
||||
})
|
||||
}
|
||||
group.Wait()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user