Skip to content

Commit

Permalink
Fix async id prefix (#535)
Browse files Browse the repository at this point in the history
It fixes these errors:

<img width="2181" alt="Screenshot 2024-07-15 at 19 27 49"
src="https://github.com/user-attachments/assets/01bb3d97-2ffa-4440-ae13-039c0f3f6a62">
  • Loading branch information
nablaone authored Jul 15, 2024
1 parent 898cd02 commit fae3e38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quesma/quesma/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (q *QueryRunner) asyncQueriesCumulatedBodySize() int {
}

func (q *QueryRunner) handlePartialAsyncSearch(ctx context.Context, id string) ([]byte, error) {
if !strings.Contains(id, "quesma_async_search_id_") {
if !strings.Contains(id, tracing.AsyncIdPrefix) {
logger.ErrorWithCtx(ctx).Msgf("non quesma async id: %v", id)
return queryparser.EmptyAsyncSearchResponse(id, false, 503)
}
Expand Down Expand Up @@ -429,7 +429,7 @@ func (q *QueryRunner) handlePartialAsyncSearch(ctx context.Context, id string) (
}

func (q *QueryRunner) deleteAsyncSeach(id string) ([]byte, error) {
if !strings.Contains(id, "quesma_async_search_id_") {
if !strings.Contains(id, tracing.AsyncIdPrefix) {
return nil, errors.New("invalid quesma async search id : " + id)
}
q.AsyncRequestStorage.Delete(id)
Expand Down

0 comments on commit fae3e38

Please sign in to comment.