mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-22 17:19:39 +02:00
chore: improve job status reporting
This commit is contained in:
@@ -19,11 +19,13 @@ export default async function (job: SandboxedJob<Repository, void>) {
|
|||||||
const repo = await getRepository(job.data.repoId);
|
const repo = await getRepository(job.data.repoId);
|
||||||
job.updateProgress({ status: "get_repo" });
|
job.updateProgress({ status: "get_repo" });
|
||||||
try {
|
try {
|
||||||
await repo.resetSate(RepositoryStatus.PREPARING, "");
|
|
||||||
job.updateProgress({ status: "resetSate" });
|
job.updateProgress({ status: "resetSate" });
|
||||||
|
await repo.resetSate(RepositoryStatus.PREPARING, "");
|
||||||
|
job.updateProgress({ status: "download" });
|
||||||
await repo.anonymize();
|
await repo.anonymize();
|
||||||
console.log(`[QUEUE] ${job.data.repoId} is downloaded`);
|
console.log(`[QUEUE] ${job.data.repoId} is downloaded`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
job.updateProgress({ status: "error" });
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
await repo.updateStatus(RepositoryStatus.ERROR, error.message);
|
await repo.updateStatus(RepositoryStatus.ERROR, error.message);
|
||||||
} else if (typeof error === "string") {
|
} else if (typeof error === "string") {
|
||||||
|
|||||||
Reference in New Issue
Block a user