fix: cancel build after 5 seconds
This commit is contained in:
@@ -1795,7 +1795,7 @@ export async function stopBuild(buildId, applicationId) {
|
||||
clearInterval(interval);
|
||||
return resolve();
|
||||
}
|
||||
if (count > 100) {
|
||||
if (count > 50) {
|
||||
clearInterval(interval);
|
||||
return reject(new Error('Build canceled'));
|
||||
}
|
||||
@@ -1807,14 +1807,15 @@ export async function stopBuild(buildId, applicationId) {
|
||||
const id = containerObj.ID;
|
||||
if (!containerObj.Names.startsWith(`${applicationId} `)) {
|
||||
await removeContainer({ id, dockerId });
|
||||
await cleanupDB(buildId);
|
||||
clearInterval(interval);
|
||||
return resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
count++;
|
||||
} catch (error) { }
|
||||
} catch (error) { } finally {
|
||||
await cleanupDB(buildId);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user