mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 After changing the History Retention Days, the file history cannot be displayed https://github.com/siyuan-note/siyuan/issues/11935
This commit is contained in:
parent
f566ef4abc
commit
e4541c9d5f
3 changed files with 6 additions and 6 deletions
|
|
@ -104,8 +104,8 @@ func queryHistory(query string, args ...interface{}) (*sql.Rows, error) {
|
|||
return historyDB.Query(query, args...)
|
||||
}
|
||||
|
||||
func deleteOutdatedHistories(tx *sql.Tx, before string, context map[string]interface{}) (err error) {
|
||||
stmt := "DELETE FROM histories_fts_case_insensitive WHERE created < ?"
|
||||
func deleteOutdatedHistories(tx *sql.Tx, before int64, context map[string]interface{}) (err error) {
|
||||
stmt := "DELETE FROM histories_fts_case_insensitive WHERE CAST(created AS INTEGER) < ?"
|
||||
if err = execStmtTx(tx, stmt, before); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ type historyDBQueueOperation struct {
|
|||
action string // index/deleteOutdated
|
||||
|
||||
histories []*History // index
|
||||
before string // deleteOutdated
|
||||
before int64 // deleteOutdated
|
||||
}
|
||||
|
||||
func FlushHistoryTxJob() {
|
||||
|
|
@ -121,7 +121,7 @@ func execHistoryOp(op *historyDBQueueOperation, tx *sql.Tx, context map[string]i
|
|||
return
|
||||
}
|
||||
|
||||
func DeleteOutdatedHistories(before string) {
|
||||
func DeleteOutdatedHistories(before int64) {
|
||||
historyDBQueueLock.Lock()
|
||||
defer historyDBQueueLock.Unlock()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue