mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 21:58:57 +02:00
fix: preserve removal intent when Redis enqueue fails
This commit is contained in:
+1
-1
@@ -203,7 +203,7 @@ export async function recoverStuckRemoving() {
|
||||
...serializeError(e),
|
||||
repoId: doc.repoId,
|
||||
});
|
||||
await markErrorIfRemoving(doc.repoId, "removal_interrupted");
|
||||
// Keep REMOVING so another recovery pass can retry the enqueue.
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -241,14 +241,9 @@ router.delete(
|
||||
const user = await getUser(req);
|
||||
isOwnerOrAdmin([repo.owner.id], user);
|
||||
await repo.updateStatus(RepositoryStatus.REMOVING);
|
||||
try {
|
||||
await addRemovalJob(repo.repoId);
|
||||
} catch (error) {
|
||||
const message =
|
||||
error instanceof Error ? error.message : "removal_enqueue_failed";
|
||||
await repo.updateStatus(RepositoryStatus.ERROR, message);
|
||||
throw error;
|
||||
}
|
||||
// Keep removal intent durable if Redis is unavailable. Recovery can
|
||||
// enqueue it later, and public requests must remain blocked meanwhile.
|
||||
await addRemovalJob(repo.repoId);
|
||||
return res.json({ status: repo.status });
|
||||
} catch (error) {
|
||||
handleError(error, res, req);
|
||||
|
||||
Reference in New Issue
Block a user