mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 18:10:26 +08:00
优化代码
This commit is contained in:
@@ -432,6 +432,10 @@ func (this *FileListDB) Close() error {
|
|||||||
_ = this.listOlderItemsStmt.Close()
|
_ = this.listOlderItemsStmt.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if this.writeBatch != nil {
|
||||||
|
this.writeBatch.Close()
|
||||||
|
}
|
||||||
|
|
||||||
var errStrings []string
|
var errStrings []string
|
||||||
|
|
||||||
if this.readDB != nil {
|
if this.readDB != nil {
|
||||||
@@ -448,10 +452,6 @@ func (this *FileListDB) Close() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.writeBatch != nil {
|
|
||||||
this.writeBatch.Close()
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(errStrings) == 0 {
|
if len(errStrings) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ For:
|
|||||||
for {
|
for {
|
||||||
// closed
|
// closed
|
||||||
if this.isClosed {
|
if this.isClosed {
|
||||||
|
if lastTx != nil {
|
||||||
|
_ = lastTx.Commit()
|
||||||
|
lastTx = nil
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user