feat/fix: thumbnail.js — growing migrate flow + deltacast cleanup
This commit is contained in:
parent
a8b59f087d
commit
b0f504ca69
1 changed files with 12 additions and 0 deletions
|
|
@ -40,6 +40,18 @@ export const thumbnailWorker = async (job) => {
|
||||||
const outputPath = join(tmpDir, `thumb-output-${job.id}.jpg`);
|
const outputPath = join(tmpDir, `thumb-output-${job.id}.jpg`);
|
||||||
|
|
||||||
try {
|
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
|
// Download proxy from S3
|
||||||
await job.updateProgress(10);
|
await job.updateProgress(10);
|
||||||
console.log(`[thumbnail] Downloading ${proxyKey} for asset ${assetId}`);
|
console.log(`[thumbnail] Downloading ${proxyKey} for asset ${assetId}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue