Skip to content

Commit 5292269

Browse files
committed
add save change logs
1 parent 92a4b4e commit 5292269

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

code/go/0chain.net/blobbercore/allocation/file_changer_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (nf *UpdateFileChanger) ApplyChange(ctx context.Context, rootRef *reference
9999
fileRef.EncryptedKeyPoint = nf.EncryptedKeyPoint
100100
fileRef.ChunkSize = nf.ChunkSize
101101
fileRef.IsPrecommit = true
102-
102+
logging.Logger.Info("UpdateFileChanger.ApplyChange", zap.Any("ThumbnailHash: ", fileRef.ThumbnailHash), zap.Any("ThumbnailSize: ", fileRef.ThumbnailSize))
103103
return rootRef, nil
104104
}
105105

code/go/0chain.net/blobbercore/allocation/file_changer_upload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import (
88
"strings"
99

1010
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
11+
"go.uber.org/zap"
1112

1213
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
1314
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/util"
1415

1516
"github.com/0chain/blobber/code/go/0chain.net/core/common"
17+
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
1618
)
1719

1820
// UploadFileChanger file change processor for continuous upload in INIT/APPEND/FINALIZE
@@ -120,6 +122,7 @@ func (nf *UploadFileChanger) applyChange(ctx context.Context, rootRef *reference
120122
HashToBeComputed: true,
121123
IsPrecommit: true,
122124
}
125+
logging.Logger.Info("UpdateFileChanger.ApplyChange", zap.Any("ThumbnailHash: ", newFile.ThumbnailHash), zap.Any("ThumbnailSize: ", newFile.ThumbnailSize))
123126

124127
fileID, ok := fileIDMeta[newFile.Path]
125128
if !ok || fileID == "" {

code/go/0chain.net/blobbercore/handler/file_command_update.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import (
99
"net/http"
1010

1111
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
12+
"go.uber.org/zap"
1213

1314
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/allocation"
1415
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
1516
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
1617
"github.com/0chain/blobber/code/go/0chain.net/core/common"
1718
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
19+
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
1820
sdkConst "github.com/0chain/gosdk/constants"
1921
"github.com/0chain/gosdk/zboxcore/fileref"
2022
)
@@ -213,6 +215,7 @@ func (cmd *UpdateFileCommand) reloadChange() {
213215
// UpdateChange add UpdateFileChanger in db
214216
func (cmd *UpdateFileCommand) UpdateChange(ctx context.Context, connectionObj *allocation.AllocationChangeCollector) error {
215217
cmd.fileChanger.AllocationID = connectionObj.AllocationID
218+
logging.Logger.Info("UpdateFileCommand.UpdateChange", zap.Any("ThumbnailSize: ", cmd.fileChanger.ThumbnailSize), zap.Any("ThumbnailHash: ", cmd.fileChanger.ThumbnailHash))
216219
for _, c := range connectionObj.Changes {
217220
filePath, _ := c.GetOrParseAffectedFilePath()
218221
if c.Operation != sdkConst.FileOperationUpdate || cmd.fileChanger.Path != filePath {

code/go/0chain.net/blobbercore/handler/file_command_upload.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ func (cmd *UploadFileCommand) reloadChange() {
230230
// UpdateChange replace AddFileChange in db
231231
func (cmd *UploadFileCommand) UpdateChange(ctx context.Context, connectionObj *allocation.AllocationChangeCollector) error {
232232
cmd.fileChanger.AllocationID = connectionObj.AllocationID
233+
logging.Logger.Info("UploadFileCommand.UpdateChange", zap.Any("ThumbnailSize: ", cmd.fileChanger.ThumbnailSize), zap.Any("ThumbnailHash: ", cmd.fileChanger.ThumbnailHash))
233234
for _, c := range connectionObj.Changes {
234235
filePath, _ := c.GetOrParseAffectedFilePath()
235236
if c.Operation != constants.FileOperationInsert || cmd.fileChanger.Path != filePath {

0 commit comments

Comments
 (0)