Skip to content

Commit 674f7a1

Browse files
committed
Add condition
1 parent d4b8f82 commit 674f7a1

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

src/billing/cloudpayments.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,19 +339,25 @@ export default class CloudPaymentsWebhooks {
339339
* }
340340
*/
341341

342-
try {
343-
await publish('cron-tasks', 'cron-tasks/limiter', JSON.stringify({
344-
type: 'unblock-workspace',
345-
workspaceId: data.workspaceId,
346-
}));
347-
} catch (e) {
348-
const error = e as Error;
349-
350-
this.sendError(res, PayCodes.SUCCESS, `[Billing / Pay] Error while sending task to limiter worker ${error.toString()}`, body);
351-
352-
return;
342+
/**
343+
* If it is not a card linking operation then unblock workspace
344+
*/
345+
if (!data.isCardLinkOperation) {
346+
try {
347+
await publish('cron-tasks', 'cron-tasks/limiter', JSON.stringify({
348+
type: 'unblock-workspace',
349+
workspaceId: data.workspaceId,
350+
}));
351+
} catch (e) {
352+
const error = e as Error;
353+
354+
this.sendError(res, PayCodes.SUCCESS, `[Billing / Pay] Error while sending task to limiter worker ${error.toString()}`, body);
355+
356+
return;
357+
}
353358
}
354359

360+
355361
try {
356362
// todo: add plan-prolongation notification if it was a payment by subscription
357363
const senderWorkerTask: PaymentSuccessNotificationTask = {

0 commit comments

Comments
 (0)