Fix api timeout (#6401)
This commit is contained in:
@ -643,7 +643,9 @@ export class WorkspaceQueryRunnerService {
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isQueryTimeoutError(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;
|
throw error;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||||
import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-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
|
// TODO: Should be properly type and based on composite type definitions
|
||||||
export const mapFieldMetadataToGraphqlQuery = (
|
export const mapFieldMetadataToGraphqlQuery = (
|
||||||
|
|||||||
@ -69,6 +69,7 @@ describe('computeParameters', () => {
|
|||||||
schema: {
|
schema: {
|
||||||
type: 'integer',
|
type: 'integer',
|
||||||
enum: [0, 1, 2],
|
enum: [0, 1, 2],
|
||||||
|
default: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -60,6 +60,7 @@ export const computeDepthParameters = (): OpenAPIV3_1.ParameterObject => {
|
|||||||
schema: {
|
schema: {
|
||||||
type: 'integer',
|
type: 'integer',
|
||||||
enum: [0, 1, 2],
|
enum: [0, 1, 2],
|
||||||
|
default: 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user