fix: fix queue admin

This commit is contained in:
tdurieux committed 2024-04-12 09:56:39 +01:00
1 parent b4ff27f560
commit daf3276f7f
2 files changed
+17 -12

No files matched your search

+3 -2
View File
@@ -52,6 +52,8 @@ export default async function (job: SandboxedJob<Repository, void>) {
try {
await repo.resetSate(RepositoryStatus.PREPARING, "");
await repo.anonymize(updateProgress);
clearInterval(statusInterval);
await repo.updateStatus(RepositoryStatus.READY, "");
console.log(`[QUEUE] ${job.data.repoId} is downloaded`);
} catch (error) {
updateProgress({ status: "error" });
@@ -72,8 +74,7 @@ export default async function (job: SandboxedJob<Repository, void>) {
// delay to avoid double saving
try {
await repo.updateStatus(RepositoryStatus.ERROR, error.message);
} catch (ignore) {
}
} catch (ignore) {}
}, 400);
} finally {
clearInterval(statusInterval);