Skip to content

Commit

Permalink
🎨 An issue that caused cloud data corruption siyuan-note/siyuan#9846
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 10, 2023
1 parent 1ab0411 commit 1a2a4a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/restic/chunker v0.4.0
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80
github.com/siyuan-note/eventbus v0.0.0-20231210025112-82fdedd8e374
github.com/siyuan-note/filelock v0.0.0-20231209021753-ecf23a6be73b
github.com/siyuan-note/httpclient v0.0.0-20231120083123-750db4d28b38
github.com/siyuan-note/logging v0.0.0-20231208035918-61f884c854f0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDj
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80 h1:XghjHKJd+SiL0DkGYFVC+UGUDFtnR4v9gkAbPeh9Eq8=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI=
github.com/siyuan-note/eventbus v0.0.0-20231210025112-82fdedd8e374 h1:haPIOZBOAEQaXsUPUpyZeOeMgw6g/9O7RBbS3d39Ta8=
github.com/siyuan-note/eventbus v0.0.0-20231210025112-82fdedd8e374/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI=
github.com/siyuan-note/filelock v0.0.0-20231209021753-ecf23a6be73b h1:IKSZ7xR5ks7bUpxbfwBPb9lgFuLTrgpNXtzMfTKBlV8=
github.com/siyuan-note/filelock v0.0.0-20231209021753-ecf23a6be73b/go.mod h1:++qrlYXSLss5AtNrHm3MNtDAQSI2gT8m3m15zLPjWJg=
github.com/siyuan-note/httpclient v0.0.0-20231120083123-750db4d28b38 h1:deUrbUOwmsNYRT0x12GHaJ8exxmDMwXFL/1J4dVnLMM=
Expand Down
4 changes: 4 additions & 0 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@ func (repo *Repo) uploadCloudMissingObjects(trafficStat *TrafficStat, context ma
checkReport.MissingObjects = append(checkReport.MissingObjects, missingObject)
}

if 0 < len(checkReport.MissingObjects) {
eventbus.Publish(eventbus.EvtCloudCorrupted)
}

data, err = gulu.JSON.MarshalJSON(checkReport)
if nil != err {
logging.LogErrorf("marshal check report failed: %s", err)
Expand Down

0 comments on commit 1a2a4a9

Please sign in to comment.