Skip to content

Commit cb5c012

Browse files
committed
Add timeout to query store rebuild wait
1 parent d7d2038 commit cb5c012

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/controllers/revision.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,13 @@ export const withdrawFromPublication = async (req: Request, res: Response, next:
452452
}
453453
};
454454

455+
const MAX_TIME_OUT = 30 * 60 * 1000;
456+
const INCREMENT = 10000;
455457
async function rebuildQueryStoreAfterCubeBuild(build: BuildLog, revision: Revision): Promise<void> {
456-
while (!CompleteStatus.includes(build.status)) {
457-
await sleep(10000);
458+
let timeout = 0;
459+
while (timeout <= MAX_TIME_OUT || !CompleteStatus.includes(build.status)) {
460+
await sleep(INCREMENT);
461+
timeout += INCREMENT;
458462
await build.reload();
459463
}
460464

0 commit comments

Comments
 (0)