feat: compact logs if they have logspam to prevent app crashing (#6181)

* feat: compact logs if they have logspam to prevent app crashing

* fix: lint
This commit is contained in:
Calum H.
2026-05-23 18:22:15 +00:00
committed by GitHub
parent f9d47e8edc
commit 8b17441f40
4 changed files with 167 additions and 41 deletions
@@ -8,7 +8,7 @@ interface LogEntry {
filename: string
name?: string
log_type: string
stdout?: string
output?: string | null
age?: number
live?: boolean
}
@@ -50,12 +50,12 @@ async function getHistoricalLogs(profilePathId: string, instancePath: string): P
const entry = getOrCreate(profilePathId)
if (entry.logList) return entry.logList
const logs: LogEntry[] = await get_logs(instancePath, false)
const logs: LogEntry[] = await get_logs(instancePath, true)
entry.logList = logs
for (const log of logs) {
if (log.stdout && log.stdout !== '') {
entry.historicalCache.set(log.filename, log.stdout)
if (log.output) {
entry.historicalCache.set(log.filename, log.output)
}
}