feat/fix: thumbnail.js — growing migrate flow + deltacast cleanup

This commit is contained in:
Zac Gaetano 2026-06-02 18:38:21 -04:00
parent a8b59f087d
commit b0f504ca69

View file

@ -40,6 +40,18 @@ export const thumbnailWorker = async (job) => {
const outputPath = join(tmpDir, `thumb-output-${job.id}.jpg`);
try {
// Check asset status before doing any work
const assetRow = await query(
'SELECT status FROM assets WHERE id = $1',
[assetId]
);
const asset = assetRow.rows[0];
if (asset?.status === 'pending_migration') {
console.log(`[thumbnail] asset ${assetId} is pending_migration, skipping`);
return;
}
// Download proxy from S3
await job.updateProgress(10);
console.log(`[thumbnail] Downloading ${proxyKey} for asset ${assetId}`);