优化代码

This commit is contained in:
刘祥超
2022-11-29 15:33:12 +08:00
parent b2a1bef08f
commit bbcfdbbf5e
5 changed files with 8 additions and 15 deletions

View File

@@ -180,6 +180,9 @@ func (this *FileListDB) Init() error {
}
this.selectHashListStmt, err = this.readDB.Prepare(`SELECT "id", "hash" FROM "` + this.itemsTableName + `" WHERE id>:id ORDER BY id ASC LIMIT 2000`)
if err != nil {
return err
}
this.deleteByHashSQL = `DELETE FROM "` + this.itemsTableName + `" WHERE "hash"=?`
this.deleteByHashStmt, err = this.writeDB.Prepare(this.deleteByHashSQL)