MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / createBackupFile

Function createBackupFile

worker/backup_handler.go:64–73  ·  view source on GitHub ↗
(h UriHandler, uri *url.URL, req *pb.BackupRequest)

Source from the content-addressed store, hash-verified

62)
63
64func createBackupFile(h UriHandler, uri *url.URL, req *pb.BackupRequest) (io.WriteCloser, error) {
65 fileName := backupName(req.ReadTs, req.GroupId)
66 dir := fmt.Sprintf(backupPathFmt, req.UnixTs)
67 if err := h.CreateDir(dir); err != nil {
68 return nil, errors.Wrap(err, "while creating backup file")
69 }
70 backupFile := filepath.Join(dir, fileName)
71 w, err := h.CreateFile(backupFile)
72 return w, errors.Wrap(err, "while creating backup file")
73}
74
75func backupName(since uint64, groupId uint32) string {
76 return fmt.Sprintf(backupNameFmt, since, groupId)

Callers 1

WriteBackupMethod · 0.85

Calls 3

backupNameFunction · 0.70
CreateDirMethod · 0.65
CreateFileMethod · 0.65

Tested by

no test coverage detected