fix: did not release db client before quiting
This commit is contained in:
parent
92678066a7
commit
c80b047e0c
@ -195,10 +195,14 @@ export const takeSnapshotForVideoWorker = async (job: Job) => {
|
|||||||
const retryInterval = type === "milestone" ? 5 * SECOND : 2 * MINUTE;
|
const retryInterval = type === "milestone" ? 5 * SECOND : 2 * MINUTE;
|
||||||
const exists = await snapshotScheduleExists(client, id);
|
const exists = await snapshotScheduleExists(client, id);
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
|
client.release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const status = await getBiliVideoStatus(client, aid);
|
const status = await getBiliVideoStatus(client, aid);
|
||||||
if (status !== 0) return `REFUSE_WORKING_BILI_STATUS_${status}`
|
if (status !== 0) {
|
||||||
|
client.release();
|
||||||
|
return `REFUSE_WORKING_BILI_STATUS_${status}`;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await setSnapshotStatus(client, id, "processing");
|
await setSnapshotStatus(client, id, "processing");
|
||||||
const stat = await insertVideoSnapshot(client, aid, task);
|
const stat = await insertVideoSnapshot(client, aid, task);
|
||||||
|
Loading…
Reference in New Issue
Block a user