Skip to content

Commit

Permalink
server: add persist file log (#4736)
Browse files Browse the repository at this point in the history
ref #4399

Signed-off-by: disksing <i@disksing.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
  • Loading branch information
disksing and ti-chi-bot committed Mar 17, 2022
1 parent a9a607b commit 766e568
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ func (s *Server) ReplicateFileToMember(ctx context.Context, member *pdpb.Member,

// PersistFile saves a file in DataDir.
func (s *Server) PersistFile(name string, data []byte) error {
log.Info("persist file", zap.String("name", name), zap.Binary("data", data))
return os.WriteFile(filepath.Join(s.GetConfig().DataDir, name), data, 0644) // #nosec
}

Expand Down

0 comments on commit 766e568

Please sign in to comment.