Skip to content

Commit

Permalink
chore: fix deepsource warnings in testutil package. (#6012)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr committed Jul 16, 2020
1 parent cfc8217 commit d696e03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion testutil/backup.go
Expand Up @@ -41,7 +41,9 @@ func openDgraph(pdir string) (*badger.DB, error) {
config := viper.New()
flags := &pflag.FlagSet{}
enc.RegisterFlags(flags)
config.BindPFlags(flags)
if err := config.BindPFlags(flags); err != nil {
return nil, err
}
config.Set("encryption_key_file", KeyFile)
k, err := enc.ReadKey(config)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions testutil/client.go
Expand Up @@ -185,11 +185,11 @@ func RetryBadQuery(dg *dgo.Dgraph, q string) (*api.Response, error) {
resp, err := txn.Query(ctx, q)
if err == nil || strings.Contains(err.Error(), "Please retry") {
time.Sleep(10 * time.Millisecond)
txn.Discard(ctx)
_ = txn.Discard(ctx)
continue
}

txn.Discard(ctx)
_ = txn.Discard(ctx)
return resp, err
}
}
Expand Down

0 comments on commit d696e03

Please sign in to comment.