mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 OCR no longer blocks document loading https://github.com/siyuan-note/siyuan/issues/9230
This commit is contained in:
parent
b31765d0ab
commit
283917a9a8
8 changed files with 123 additions and 11 deletions
|
|
@ -51,6 +51,7 @@ type dbQueueOperation struct {
|
|||
box string // delete_box/delete_box_refs/index
|
||||
renameTree *parse.Tree // rename/rename_sub_tree
|
||||
block *Block // update_block_content
|
||||
id string // index_node
|
||||
removeAssetHashes []string // delete_assets
|
||||
}
|
||||
|
||||
|
|
@ -191,6 +192,8 @@ func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (e
|
|||
err = updateBlockContent(tx, op.block)
|
||||
case "delete_assets":
|
||||
err = deleteAssetsByHashes(tx, op.removeAssetHashes)
|
||||
case "index_node":
|
||||
err = indexNode(tx, op.id)
|
||||
default:
|
||||
msg := fmt.Sprintf("unknown operation [%s]", op.action)
|
||||
logging.LogErrorf(msg)
|
||||
|
|
@ -199,6 +202,20 @@ func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (e
|
|||
return
|
||||
}
|
||||
|
||||
func IndexNodeQueue(id string) {
|
||||
dbQueueLock.Lock()
|
||||
defer dbQueueLock.Unlock()
|
||||
|
||||
newOp := &dbQueueOperation{id: id, inQueueTime: time.Now(), action: "index_node"}
|
||||
for i, op := range operationQueue {
|
||||
if "index_node" == op.action && op.id == id {
|
||||
operationQueue[i] = newOp
|
||||
return
|
||||
}
|
||||
}
|
||||
operationQueue = append(operationQueue, newOp)
|
||||
}
|
||||
|
||||
func BatchRemoveAssetsQueue(hashes []string) {
|
||||
if 1 > len(hashes) {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue