Skip to content

Commit

Permalink
🎨 Support manual purge of unreferenced data snapshots in the S3/WebDA…
Browse files Browse the repository at this point in the history
…V cloud storage siyuan-note/siyuan#10081
  • Loading branch information
88250 committed Jan 24, 2024
1 parent 2abbc23 commit be48ff3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (repo *Repo) PurgeCloud() (ret *entity.PurgeStat, err error) {
checkIndexPath := path.Join("check", "indexes", checkIndexID)
unreferencedCheckIndexPaths = append(unreferencedCheckIndexPaths, checkIndexPath)
}
eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexes, context, unreferencedCheckIndexPaths)
eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexes, context)
err = repo.removeCloudObjects(unreferencedCheckIndexPaths)
if nil != err {
logging.LogErrorf("remove unreferenced check indexes failed: %s", err)
Expand All @@ -308,15 +308,15 @@ func (repo *Repo) PurgeCloud() (ret *entity.PurgeStat, err error) {
unreferencedIndexPaths = append(unreferencedIndexPaths, indexPath)
}

eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexes, context, unreferencedIndexPaths)
eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexes, context)
err = repo.removeCloudObjects(unreferencedIndexPaths)
if nil != err {
logging.LogErrorf("remove unreferenced indexes failed: %s", err)
return
}

// 清理索引列表
eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexesV2, context, refIndexIDs)
eventbus.Publish(eventbus.EvtCloudPurgeRemoveIndexesV2, context)
err = repo.purgeIndexesV2(refIndexIDs)
if nil != err {
logging.LogErrorf("purge indexes-v2.json failed: %s", err)
Expand All @@ -329,7 +329,7 @@ func (repo *Repo) PurgeCloud() (ret *entity.PurgeStat, err error) {
objPath := path.Join("objects", unreferencedPath)
unreferencedObjPaths = append(unreferencedObjPaths, objPath)
}
eventbus.Publish(eventbus.EvtCloudPurgeRemoveObjects, context, unreferencedObjPaths)
eventbus.Publish(eventbus.EvtCloudPurgeRemoveObjects, context)
err = repo.removeCloudObjects(unreferencedObjPaths)
if nil != err {
logging.LogErrorf("remove unreferenced objects failed: %s", err)
Expand Down

0 comments on commit be48ff3

Please sign in to comment.