fix: load logs after build failed
This commit is contained in:
@@ -61,12 +61,27 @@
|
|||||||
fromDb = from;
|
fromDb = from;
|
||||||
|
|
||||||
streamInterval = setInterval(async () => {
|
streamInterval = setInterval(async () => {
|
||||||
|
const nextSequence = logs[logs.length - 1]?.time || 0;
|
||||||
if (status !== 'running' && status !== 'queued') {
|
if (status !== 'running' && status !== 'queued') {
|
||||||
loading = false;
|
loading = false;
|
||||||
|
try {
|
||||||
|
const data = await get(
|
||||||
|
`/applications/${id}/logs/build/${$selectedBuildId}?sequence=${nextSequence}`
|
||||||
|
);
|
||||||
|
status = data.status;
|
||||||
|
currentStatus = status;
|
||||||
|
fromDb = data.fromDb;
|
||||||
|
|
||||||
|
logs = logs.concat(
|
||||||
|
data.logs.map((log: any) => ({ ...log, line: cleanAnsiCodes(log.line) }))
|
||||||
|
);
|
||||||
|
loading = false;
|
||||||
|
} catch (error) {
|
||||||
|
return errorNotification(error);
|
||||||
|
}
|
||||||
clearInterval(streamInterval);
|
clearInterval(streamInterval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const nextSequence = logs[logs.length - 1]?.time || 0;
|
|
||||||
try {
|
try {
|
||||||
const data = await get(
|
const data = await get(
|
||||||
`/applications/${id}/logs/build/${$selectedBuildId}?sequence=${nextSequence}`
|
`/applications/${id}/logs/build/${$selectedBuildId}?sequence=${nextSequence}`
|
||||||
|
|||||||
Reference in New Issue
Block a user