MCPcopy
hub / github.com/dgraph-io/dgraph / resolveRestore

Function resolveRestore

graphql/admin/restore.go:77–106  ·  view source on GitHub ↗
(ctx context.Context, m schema.Mutation)

Source from the content-addressed store, hash-verified

75}
76
77func resolveRestore(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {
78 input, err := getRestoreInput(m)
79 if err != nil {
80 return resolve.EmptyResult(m, err), false
81 }
82 glog.Infof("Got restore request, location: %v, backupId: %v, backupNum: %v, incrementalFrom: %d, isPartial: %v",
83 input.Location, input.BackupId, input.BackupNum, input.IncrementalFrom, input.IsPartial)
84
85 req := pb.RestoreRequest{
86 Location: input.Location,
87 BackupId: input.BackupId,
88 BackupNum: uint64(input.BackupNum),
89 IncrementalFrom: uint64(input.IncrementalFrom),
90 IsPartial: input.IsPartial,
91 EncryptionKeyFile: input.EncryptionKeyFile,
92 AccessKey: input.AccessKey,
93 SecretKey: input.SecretKey,
94 SessionToken: input.SessionToken,
95 Anonymous: input.Anonymous,
96 VaultAddr: input.VaultAddr,
97 VaultRoleidFile: input.VaultRoleIDFile,
98 VaultSecretidFile: input.VaultSecretIDFile,
99 VaultPath: input.VaultPath,
100 VaultField: input.VaultField,
101 VaultFormat: input.VaultFormat,
102 IsNamespaceAwareRestore: false,
103 }
104
105 return restore(ctx, m, req)
106}
107
108func restore(ctx context.Context, m schema.Mutation, req pb.RestoreRequest) (*resolve.Resolved, bool) {
109 wg := &sync.WaitGroup{}

Callers

nothing calls this directly

Calls 4

EmptyResultFunction · 0.92
getRestoreInputFunction · 0.85
InfofMethod · 0.80
restoreFunction · 0.70

Tested by

no test coverage detected