Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout #46

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ export class EventHistory {
name: null,
symbol: null,
};
instance.fromAddress = log.topics[1].substring(26);
instance.toAddress = log.topics[2].substring(26);
instance.fromAddress = ethers
.getAddress(`0x${log.topics[1].substring(26)}`)
.toLowerCase();
instance.toAddress = ethers
.getAddress(`0x${log.topics[2].substring(26)}`)
.toLowerCase();
// instance.tokenId = '0';
instance.tokenValue = tokenValue;
// instance.nativeAmount = '0';
Expand Down Expand Up @@ -173,8 +177,12 @@ export class EventHistory {
name: null,
symbol: null,
};
instance.fromAddress = log.topics[1].substring(26);
instance.toAddress = log.topics[2].substring(26);
instance.fromAddress = ethers
.getAddress(`0x${log.topics[1].substring(26)}`)
.toLowerCase();
instance.toAddress = ethers
.getAddress(`0x${log.topics[2].substring(26)}`)
.toLowerCase();
instance.tokenId = tokenId;
// instance.tokenValue = '0';
// instance.nativeAmount = '0';
Expand Down
22 changes: 11 additions & 11 deletions app/libs/shared_modules/src/webhook/webhook.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sendDelete, sendGet, sendPost, sendPut } from '@app/utils/http.util';
import { Injectable, Logger } from '@nestjs/common';
import { WebhookDeliveryDto } from 'apps/monitor-service/src/ethereum/dto/eth.webhook-delivery.dto';

const MAX_ATTEMPT = 3;
const MAX_TIMEOUT = 5;
@Injectable()
export class WebhookService {
private readonly logger = new Logger(WebhookService.name);
Expand All @@ -26,7 +26,7 @@ export class WebhookService {
"authorization_token": "my-authorization-token",
"active": true,
"max_delivery_attempts": 5,
"delivery_attempt_timeout": 1,
"delivery_attempt_timeout": 5,
"retry_min_backoff": 10,
"retry_max_backoff": 60
}'
Expand All @@ -45,8 +45,8 @@ export class WebhookService {
secret_token: secret_token,
authorization_token: authorization,
active: true,
max_delivery_attempts: 5,
delivery_attempt_timeout: 1,
max_delivery_attempts: MAX_ATTEMPT,
delivery_attempt_timeout: MAX_TIMEOUT,
retry_min_backoff: 10,
retry_max_backoff: 60,
};
Expand Down Expand Up @@ -289,8 +289,8 @@ export class WebhookService {
secret_token: secret_token,
authorization_token: authorization,
active: active,
max_delivery_attempts: 5,
delivery_attempt_timeout: 1,
max_delivery_attempts: MAX_ATTEMPT,
delivery_attempt_timeout: MAX_TIMEOUT,
retry_min_backoff: 10,
retry_max_backoff: 60,
};
Expand All @@ -303,12 +303,12 @@ export class WebhookServiceResponseDto {
active: true;
content_type: string;
created_at: string;
delivery_attempt_timeout: 0;
delivery_attempt_timeout: number;
id: string;
max_delivery_attempts: 0;
max_delivery_attempts: number;
name: string;
retry_max_backoff: 0;
retry_min_backoff: 0;
retry_max_backoff: number;
retry_min_backoff: number;
secret_token: string;
authorization_token: string;
updated_at: string;
Expand Down