Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix api timeout #6401

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading