Skip to content

Commit

Permalink
Fix api timeout (#6401)
Browse files Browse the repository at this point in the history
  • Loading branch information
martmull authored Jul 25, 2024
1 parent 082d55b commit 7c6ca0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,9 @@ export class WorkspaceQueryRunnerService {
);
} catch (error) {
if (isQueryTimeoutError(error)) {
throw new RequestTimeoutException(error.message);
throw new RequestTimeoutException(
'The SQL request took too long to process, resulting in a query read timeout. To resolve this issue, consider modifying your query by reducing the depth of relationships or limiting the number of records being fetched.',
);
}

throw error;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';

const DEFAULT_DEPTH_VALUE = 2;
const DEFAULT_DEPTH_VALUE = 1;

// TODO: Should be properly type and based on composite type definitions
export const mapFieldMetadataToGraphqlQuery = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('computeParameters', () => {
schema: {
type: 'integer',
enum: [0, 1, 2],
default: 1,
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const computeDepthParameters = (): OpenAPIV3_1.ParameterObject => {
schema: {
type: 'integer',
enum: [0, 1, 2],
default: 1,
},
};
};
Expand Down

0 comments on commit 7c6ca0e

Please sign in to comment.