mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix(federation): 🐛 Correctly handle job failures in inboxes
This commit is contained in:
parent
c59ebef851
commit
d527947182
2 changed files with 21 additions and 23 deletions
|
|
@ -116,12 +116,18 @@ export default apiRoute((app) =>
|
|||
ip: context.env.ip ?? null,
|
||||
});
|
||||
|
||||
return new Promise<Response>((resolve) => {
|
||||
return new Promise<Response>((resolve, reject) => {
|
||||
inboxWorker.on("completed", (job) => {
|
||||
if (job.id === result.id) {
|
||||
resolve(job.returnvalue);
|
||||
}
|
||||
});
|
||||
|
||||
inboxWorker.on("failed", (job) => {
|
||||
if (job && job.id === result.id) {
|
||||
reject(job.returnvalue);
|
||||
}
|
||||
});
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue