const test = await program.pipe(
Effect.retry({
times: 3,
schedule: Schedule.exponential("500 millis"),
}),
Effect.catchTags({
ConvexError: (error) => {
return Effect.promise(() =>
Promise.all(
args.messages.map(async (m) => {
return await ctx.runMutation(internal.infobip.patchError, {
messageId: m.messageId as Id<"messages">,
});
}),
),
);
},
InfobipError: (error) => {
console.log("INFOBIP ERROR");
args.messages.forEach((m) => {
ctx.runMutation(internal.infobip.patchError, {
messageId: m.messageId as Id<"messages">,
});
});
// run mutation to db to record error
return Effect.fail(error);
},
}),
Effect.runPromiseExit,
);
const test = await program.pipe(
Effect.retry({
times: 3,
schedule: Schedule.exponential("500 millis"),
}),
Effect.catchTags({
ConvexError: (error) => {
return Effect.promise(() =>
Promise.all(
args.messages.map(async (m) => {
return await ctx.runMutation(internal.infobip.patchError, {
messageId: m.messageId as Id<"messages">,
});
}),
),
);
},
InfobipError: (error) => {
console.log("INFOBIP ERROR");
args.messages.forEach((m) => {
ctx.runMutation(internal.infobip.patchError, {
messageId: m.messageId as Id<"messages">,
});
});
// run mutation to db to record error
return Effect.fail(error);
},
}),
Effect.runPromiseExit,
);