Skip to content

Commit

Permalink
Implement node limiter while merging results in parallel calls under …
Browse files Browse the repository at this point in the history
…the AQL resolver
  • Loading branch information
lkarlslund committed Dec 16, 2024
1 parent dce7eab commit 0e73de1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/aql/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,12 @@ func (aqlq AQLquery) Resolve(opts ResolverOptions) (*graph.Graph[*engine.Object,
searchResult := graph.NewGraph[*engine.Object, engine.EdgeBitmap]()
aqlq.resolveEdgesFrom(opts, &searchResult, nil, o, 0, 0, 0, 1)
resultlock.Lock()
result.Merge(searchResult)
resultlock.Unlock()
return true
defer resultlock.Unlock()
if opts.NodeLimit == 0 || result.Order() <= opts.NodeLimit {
result.Merge(searchResult)
return true
}
return false
}, 0)
return &result, nil
}
Expand Down

0 comments on commit 0e73de1

Please sign in to comment.