Skip to content

Commit

Permalink
Merge pull request #48 from atomist-skills/reinstate-previous-query-f…
Browse files Browse the repository at this point in the history
…etch

reinstate the check for existing results that accidentally got removed
  • Loading branch information
chrispatrick authored Feb 6, 2024
2 parents 57cf86a + 6a990e7 commit d27da95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy/data/gql_async.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func NewAsyncDataSource(
}

func (ds AsyncDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error) {
if existingResult, ok := ds.asyncResults[queryName]; ok {
return &QueryResponse{}, edn.Unmarshal(existingResult.Data, output)
}

if len(ds.asyncResults) > 0 && !ds.multipleQuerySupport {
ds.log.Debugf("skipping async query for query %s due to lack of multipleQuerySupport", queryName)
return nil, nil // don't error, in case there is another applicable query executor down-chain
Expand Down

0 comments on commit d27da95

Please sign in to comment.