fix: docker log sequence

This commit is contained in:
Andras Bacsai 2023-01-16 10:06:41 +01:00
parent d641d32413
commit 2fd001f6d2
5 changed files with 1617 additions and 1380 deletions

View File

@ -1605,12 +1605,7 @@ export async function getApplicationLogs(request: FastifyRequest<GetApplicationL
.split('\n')
.map((l) => ansi(l))
.filter((a) => a);
const logs = stripLogsStderr.concat(stripLogsStdout);
const sortedLogs = logs.sort((a, b) =>
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
);
return { logs: sortedLogs };
// }
return { logs: stripLogsStderr.concat(stripLogsStdout) };
} catch (error) {
const { statusCode, stderr } = error;
if (stderr.startsWith('Error: No such container')) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -561,12 +561,7 @@ export const applicationsRouter = router({
.split('\n')
.map((l) => ansi(l))
.filter((a) => a);
const logs = stripLogsStderr.concat(stripLogsStdout);
const sortedLogs = logs.sort((a, b) =>
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
);
return { logs: sortedLogs };
// }
return { logs: stripLogsStderr.concat(stripLogsStdout) };
} catch (error) {
const { statusCode, stderr } = error;
if (stderr.startsWith('Error: No such container')) {

View File

@ -68,16 +68,11 @@ export const servicesRouter = router({
.split('\n')
.map((l) => ansi(l))
.filter((a) => a);
const logs = stripLogsStderr.concat(stripLogsStdout);
const sortedLogs = logs.sort((a, b) =>
day(a.split(' ')[0]).isAfter(day(b.split(' ')[0])) ? 1 : -1
);
return {
data: {
logs: sortedLogs
logs: stripLogsStderr.concat(stripLogsStdout)
}
};
// }
} catch (error) {
const { statusCode, stderr } = error;
if (stderr.startsWith('Error: No such container')) {
@ -92,7 +87,6 @@ export const servicesRouter = router({
return {
data: {
logs: []
}
};
}