fix: handle ALICLOUD_PROXY_ERR error in snapshotVideoWorker
This commit is contained in:
parent
a67d896d86
commit
1a86831e90
@ -273,7 +273,7 @@ class NetworkDelegate {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(e as Error, "net", "fn:alicloudFcRequest");
|
logger.error(e as Error, "net", "fn:alicloudFcRequest");
|
||||||
throw new NetSchedulerError(`Unhandled error: Cannot proxy ${url} to ali-fc.`, "ALICLOUD_PROXY_ERR", e);
|
throw new NetSchedulerError(`Unhandled error: Cannot proxy ${url} to ali-fc-${region}.`, "ALICLOUD_PROXY_ERR", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,15 @@ export const snapshotVideoWorker = async (job: Job): Promise<void> => {
|
|||||||
await scheduleSnapshot(client, aid, type, Date.now() + retryInterval);
|
await scheduleSnapshot(client, aid, type, Date.now() + retryInterval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (e instanceof NetSchedulerError && e.code === "ALICLOUD_PROXY_ERR") {
|
||||||
|
logger.warn(
|
||||||
|
`Failed to proxy request for aid ${job.data.aid}: ${e.message}`,
|
||||||
|
"mq",
|
||||||
|
"fn:takeSnapshotForVideoWorker",
|
||||||
|
);
|
||||||
|
await setSnapshotStatus(client, id, "failed");
|
||||||
|
await scheduleSnapshot(client, aid, type, Date.now() + retryInterval);
|
||||||
|
}
|
||||||
logger.error(e as Error, "mq", "fn:takeSnapshotForVideoWorker");
|
logger.error(e as Error, "mq", "fn:takeSnapshotForVideoWorker");
|
||||||
await setSnapshotStatus(client, id, "failed");
|
await setSnapshotStatus(client, id, "failed");
|
||||||
}, async () => {
|
}, async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user