Skip to content

Commit

Permalink
refactor(storylog): rename and re-doc (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangze-Li authored Apr 2, 2024
1 parent 18cf1dd commit 2f9b61c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dice/storylog/upload_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func uploadV1(ctx UploadContext) (string, error) {
}
ctx.lines = lines

err = backupBeforeUpload(&ctx)
err = formatAndBackup(&ctx)
if err != nil {
return "", err
}
Expand All @@ -71,8 +71,8 @@ func uploadV1(ctx UploadContext) (string, error) {
return url, nil
}

// backupBeforeUpload 将导出的日志留档 zip,会修改 ctx.data
func backupBeforeUpload(ctx *UploadContext) error {
// formatAndBackup 将导出的日志序列化到 ctx.data 并存储为本地 zip
func formatAndBackup(ctx *UploadContext) error {
fzip, _ := os.OpenFile(
filepath.Join(ctx.Dir, filenameReplace(fmt.Sprintf(
"%s_%s.%s.zip",
Expand Down Expand Up @@ -105,7 +105,7 @@ func backupBeforeUpload(ctx *UploadContext) error {
if err == nil {
fileWriter2, _ := writer.Create(ExportJsonFilename)
_, _ = fileWriter2.Write(data)
ctx.data = &data //nolint:govet
ctx.data = &data
}

_ = writer.Close()
Expand Down

0 comments on commit 2f9b61c

Please sign in to comment.