mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
✨ Support for searching asset content https://github.com/siyuan-note/siyuan/issues/8874
This commit is contained in:
parent
1aa4049750
commit
7d992ce175
21 changed files with 568 additions and 76 deletions
|
|
@ -55,8 +55,8 @@ func FlushHistoryQueue() {
|
|||
return
|
||||
}
|
||||
|
||||
txLock.Lock()
|
||||
defer txLock.Unlock()
|
||||
historyTxLock.Lock()
|
||||
defer historyTxLock.Unlock()
|
||||
start := time.Now()
|
||||
|
||||
groupOpsTotal := map[string]int{}
|
||||
|
|
@ -145,27 +145,3 @@ func getHistoryOperations() (ops []*historyDBQueueOperation) {
|
|||
historyOperationQueue = nil
|
||||
return
|
||||
}
|
||||
|
||||
func WaitForWritingHistoryDatabase() {
|
||||
var printLog bool
|
||||
var lastPrintLog bool
|
||||
for i := 0; isWritingHistoryDatabase(); i++ {
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
if 200 < i && !printLog { // 10s 后打日志
|
||||
logging.LogWarnf("history database is writing: \n%s", logging.ShortStack())
|
||||
printLog = true
|
||||
}
|
||||
if 1200 < i && !lastPrintLog { // 60s 后打日志
|
||||
logging.LogWarnf("history database is still writing")
|
||||
lastPrintLog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func isWritingHistoryDatabase() bool {
|
||||
time.Sleep(util.SQLFlushInterval + 50*time.Millisecond)
|
||||
if 0 < len(historyOperationQueue) || util.IsMutexLocked(&historyTxLock) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue