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: Disable the default timeout for requests on the LU build #4295

Merged
merged 13 commits into from
Nov 17, 2020
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 @@ -373,6 +373,7 @@ describe('publish luis files', () => {
crossTrainConfig: {},
luFiles: [],
},
setTimeout: (msecs: number, callback: () => any): void => {},
} as Request;
await ProjectController.build(mockReq, mockRes);
expect(mockRes.status).toHaveBeenCalled();
Expand Down
5 changes: 5 additions & 0 deletions Composer/packages/server/src/controllers/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ async function build(req: Request, res: Response) {
const projectId = req.params.projectId;
const user = await ExtensionContext.getUserFromRequest(req);

// Disable Express' built in 2 minute timeout for requests. Otherwise, large models may fail to build.
req.setTimeout(0, () => {
throw new Error('LUIS publish process timed out.');
});

const currentProject = await BotProjectService.getProjectById(projectId, user);
if (currentProject !== undefined) {
try {
Expand Down