mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Update av
This commit is contained in:
parent
d96f09d2d4
commit
be1b34a163
2 changed files with 12 additions and 11 deletions
|
|
@ -78,6 +78,7 @@ func performTransactions(c *gin.Context) {
|
||||||
func pushTransactions(app, session string, transactions []*model.Transaction) {
|
func pushTransactions(app, session string, transactions []*model.Transaction) {
|
||||||
pushMode := util.PushModeBroadcastExcludeSelf
|
pushMode := util.PushModeBroadcastExcludeSelf
|
||||||
if 0 < len(transactions) && 0 < len(transactions[0].DoOperations) {
|
if 0 < len(transactions) && 0 < len(transactions[0].DoOperations) {
|
||||||
|
model.WaitForWritingFiles()
|
||||||
if strings.Contains(strings.ToLower(transactions[0].DoOperations[0].Action), "attrview") {
|
if strings.Contains(strings.ToLower(transactions[0].DoOperations[0].Action), "attrview") {
|
||||||
pushMode = util.PushModeBroadcast
|
pushMode = util.PushModeBroadcast
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,17 +200,17 @@ func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
func RebuildAttributeViewQueue(av *av.AttributeView) {
|
func RebuildAttributeViewQueue(av *av.AttributeView) {
|
||||||
dbQueueLock.Lock()
|
//dbQueueLock.Lock()
|
||||||
defer dbQueueLock.Unlock()
|
//defer dbQueueLock.Unlock()
|
||||||
|
//
|
||||||
newOp := &dbQueueOperation{av: av, inQueueTime: time.Now(), action: "av_rebuild"}
|
//newOp := &dbQueueOperation{av: av, inQueueTime: time.Now(), action: "av_rebuild"}
|
||||||
for i, op := range operationQueue {
|
//for i, op := range operationQueue {
|
||||||
if "av_rebuild" == op.action && op.av.ID == av.ID {
|
// if "av_rebuild" == op.action && op.av.ID == av.ID {
|
||||||
operationQueue[i] = newOp
|
// operationQueue[i] = newOp
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
operationQueue = append(operationQueue, newOp)
|
//operationQueue = append(operationQueue, newOp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func BatchRemoveAssetsQueue(hashes []string) {
|
func BatchRemoveAssetsQueue(hashes []string) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue