Skip to content

Commit

Permalink
allow config webhook retry on create monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
cauta committed May 30, 2024
1 parent 9f3f3ee commit ce7d0a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/libs/shared_modules/src/webhook/webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class WebhookService {
webhookUrl: string,
secret_token: string,
authorization: string,
retry?: number,
): Promise<string> {
const createWebhookDto = {
name: name,
Expand All @@ -45,7 +46,7 @@ export class WebhookService {
secret_token: secret_token,
authorization_token: authorization,
active: true,
max_delivery_attempts: MAX_ATTEMPT,
max_delivery_attempts: retry || MAX_ATTEMPT,
delivery_attempt_timeout: MAX_TIMEOUT,
retry_min_backoff: 10,
retry_max_backoff: 60,
Expand Down Expand Up @@ -125,6 +126,7 @@ export class WebhookService {
authorization: string;
secret_token: string;
active: boolean;
retry?: number;
},
) {
try {
Expand All @@ -134,6 +136,7 @@ export class WebhookService {
options.authorization,
options.secret_token,
options.active,
options.retry,
);
const response = await sendPut(
`${this.webhookUrl}/v1/webhooks/${webhookId}`,
Expand Down Expand Up @@ -282,6 +285,7 @@ export class WebhookService {
authorization: string,
secret_token: string,
active: boolean,
retry: number,
): UpdateWebhookRequestDto {
const updateWebhookDto = {
name: name,
Expand All @@ -291,7 +295,7 @@ export class WebhookService {
secret_token: secret_token,
authorization_token: authorization,
active: active,
max_delivery_attempts: MAX_ATTEMPT,
max_delivery_attempts: retry || MAX_ATTEMPT,
delivery_attempt_timeout: MAX_TIMEOUT,
retry_min_backoff: 10,
retry_max_backoff: 60,
Expand Down

0 comments on commit ce7d0a1

Please sign in to comment.