Skip to content

Commit

Permalink
refactor: use a context with cache for query
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersiddhu committed Sep 13, 2018
1 parent f8f3130 commit f657faa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage/arangodb/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ func (a *arangoSource) IsUpdatedOboGraph(g graph.OboGraph) bool {
"@collection": a.graphc.Name(),
"identifier": g.ID(),
}
cursor, err := a.database.Query(context.Background(), query, bindVars)
ctx := driver.WithQueryCache(context.Background(), true)
cursor, err := a.database.Query(ctx, query, bindVars)
defer cursor.Close()
_, err := cursor.ReadDocument(context.Background(), ts)
_, err := cursor.ReadDocument(ctx, ts)
if err != nil {
return err
}
Expand Down

0 comments on commit f657faa

Please sign in to comment.