Skip to content

Commit

Permalink
fix async request porcessing
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Jan 14, 2025
1 parent 3ecc87f commit 5877256
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1834,10 +1834,10 @@ class ApiGateway {
if (props.queryType === 'multi') {
// We prepare the final json result on native side
const resultMulti = new ResultMultiWrapper(results, { queryType, slowQuery });
res(resultMulti);
return res(resultMulti);
} else {
// We prepare the full final json result on native side
res(results[0]);
return res(results[0]);
}
} catch (e: any) {
this.handleError({
Expand Down Expand Up @@ -1936,7 +1936,7 @@ class ApiGateway {
}];
}

res(request.streaming ? results[0] : { results });
return res(request.streaming ? results[0] : { results });
} else {
results = await Promise.all(
normalizedQueries.map(async (normalizedQuery, index) => {
Expand Down Expand Up @@ -1970,11 +1970,11 @@ class ApiGateway {
);

if (request.streaming) {
res(results[0]);
return res(results[0]);
} else {
// We prepare the final json result on native side
const resultArray = new ResultArrayWrapper(results);
res(resultArray);
return res(resultArray);
}
}
} catch (e: any) {
Expand Down

0 comments on commit 5877256

Please sign in to comment.