From fb3b998cfd94aab08f562c3a3e4f3950081b0835 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Mon, 18 May 2026 23:51:04 -0400 Subject: [PATCH] fix(worker/thumbnail): mark asset ready even when thumbnail extraction fails If the thumbnail job throws (network blip, ffmpeg error, short clip), the asset was left stuck in status='processing' indefinitely. Since the proxy already exists and the asset is playable, set status='ready' in the catch block before re-throwing so BullMQ can still record the failure. --- services/worker/src/workers/thumbnail.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/worker/src/workers/thumbnail.js b/services/worker/src/workers/thumbnail.js index ac7ca00..a10ceae 100644 --- a/services/worker/src/workers/thumbnail.js +++ b/services/worker/src/workers/thumbnail.js @@ -64,7 +64,12 @@ export const thumbnailWorker = async (job) => { return { assetId, outputKey }; } catch (error) { console.error(`[thumbnail] Error processing asset ${assetId}:`, error); - // Don't set status=error for thumbnail failure — asset is still usable without it + // Thumbnail failed but the asset is still usable via proxy — mark it ready + // so it doesn't stay in 'processing' state forever. + await query( + `UPDATE assets SET status = 'ready', updated_at = NOW() WHERE id = $1`, + [assetId] + ).catch(e => console.error('[thumbnail] Failed to update asset status:', e)); throw error; } finally { await Promise.all([