feat: add thumbnail timeout and low-memory warning

This commit is contained in:
tianmo committed 2026-10-17 16:19:18 +08:00
1 parent 7b2fae6335
commit 76328fa058
10 files changed
+196 -17

No files matched your search

+6 -1
View File
@@ -1,4 +1,5 @@
import { requireUserAuth } from '../../utils/access'
import { detectSystemMemory } from '../../utils/system-resources'
import {
getTranscodeSettings,
MAX_TRANSCODE_CONCURRENCY,
@@ -11,12 +12,16 @@ import {
export default defineEventHandler(async (event) => {
await requireUserAuth(event)
const memory = detectSystemMemory()
return {
...getTranscodeSettings(),
maxConcurrency: MAX_TRANSCODE_CONCURRENCY,
maxThreads: MAX_TRANSCODE_THREADS,
minBitratePercent: MIN_TRANSCODE_BITRATE_PERCENT,
maxBitratePercent: MAX_TRANSCODE_BITRATE_PERCENT,
presets: TRANSCODE_PRESETS
presets: TRANSCODE_PRESETS,
memoryBytes: memory.totalBytes,
lowMemoryThresholdBytes: memory.thresholdBytes,
lowMemory: memory.lowMemory
}
})