mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
limit rawLogs to max number of lines by trimming old entries
https://github.com/Dokploy/dokploy/issues/1815
This commit is contained in:
parent
c13a68dab4
commit
3ec339fc89
@ -140,7 +140,14 @@ export const DockerLogsId: React.FC<Props> = ({
|
||||
|
||||
ws.onmessage = (e) => {
|
||||
if (!isCurrentConnection) return;
|
||||
setRawLogs((prev) => prev + e.data);
|
||||
setRawLogs((prev) => {
|
||||
const updated = prev + e.data;
|
||||
const splitLines = updated.split('\n');
|
||||
if (splitLines.length > lines) {
|
||||
return splitLines.slice(-lines).join('\n');
|
||||
}
|
||||
return updated;
|
||||
});
|
||||
setIsLoading(false);
|
||||
if (noDataTimeout) clearTimeout(noDataTimeout);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user