MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / CommitWithStorageDiff

Function CommitWithStorageDiff

inventory/tx.go:103–118  ·  view source on GitHub ↗

CommitWithStorageDiff commits the transaction and applies the storage diff, only if the transaction is not inherited.

(ctx context.Context, tx *Tx, l logging.Logger, uc UserClient)

Source from the content-addressed store, hash-verified

101
102// CommitWithStorageDiff commits the transaction and applies the storage diff, only if the transaction is not inherited.
103func CommitWithStorageDiff(ctx context.Context, tx *Tx, l logging.Logger, uc UserClient) error {
104 commited, err := commit(tx)
105 if err != nil {
106 return err
107 }
108
109 if !commited {
110 return nil
111 }
112
113 if err := uc.ApplyStorageDiff(ctx, tx.storageDiff); err != nil {
114 l.Error("Failed to apply storage diff", "error", err)
115 }
116
117 return nil
118}

Callers 9

DeleteMethod · 0.92
PrepareUploadMethod · 0.92
CompleteUploadMethod · 0.92
CreateEntityMethod · 0.92
createFileMethod · 0.92
DeleteMethod · 0.92
MoveOrCopyMethod · 0.92
setCurrentVersionMethod · 0.92
RecycleEntitiesMethod · 0.92

Calls 3

commitFunction · 0.85
ApplyStorageDiffMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected