mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00: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);
|
||||
job.updateProgress({ status: "get_repo" });
|
||||
try {
|
||||
await repo.resetSate(RepositoryStatus.PREPARING, "");
|
||||
job.updateProgress({ status: "resetSate" });
|
||||
await repo.resetSate(RepositoryStatus.PREPARING, "");
|
||||
job.updateProgress({ status: "download" });
|
||||
await repo.anonymize();
|
||||
console.log(`[QUEUE] ${job.data.repoId} is downloaded`);
|
||||
} catch (error) {
|
||||
job.updateProgress({ status: "error" });
|
||||
if (error instanceof Error) {
|
||||
await repo.updateStatus(RepositoryStatus.ERROR, error.message);
|
||||
} else if (typeof error === "string") {
|
||||
|
||||
Reference in New Issue
Block a user