From d1804b305dba0d6177426a5ef3762567143a6096 Mon Sep 17 00:00:00 2001 From: fibonacci998 Date: Thu, 21 Mar 2024 10:01:14 +0700 Subject: [PATCH] feat: add concurrency to job crawl account --- ci/config.json.ci | 9 +++++++++ config.json | 9 +++++++++ src/services/crawl-account/crawl_account.service.ts | 7 +++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ci/config.json.ci b/ci/config.json.ci index c54b6f645..820877a5e 100644 --- a/ci/config.json.ci +++ b/ci/config.json.ci @@ -65,6 +65,15 @@ "crawlAccount": { "handleVestingAccount": { "millisecondCrawl": 30000 + }, + "crawlAccountAuth": { + "concurrency": 100 + }, + "crawlAccountBalance": { + "concurrency": 100 + }, + "crawlAccountSpendableBalance": { + "concurrency": 100 } }, "crawlProposal": { diff --git a/config.json b/config.json index 5909006f0..83f008eed 100644 --- a/config.json +++ b/config.json @@ -65,6 +65,15 @@ "crawlAccount": { "handleVestingAccount": { "millisecondCrawl": 30000 + }, + "crawlAccountAuth": { + "concurrency": 100 + }, + "crawlAccountBalance": { + "concurrency": 100 + }, + "crawlAccountSpendableBalance": { + "concurrency": 100 } }, "crawlProposal": { diff --git a/src/services/crawl-account/crawl_account.service.ts b/src/services/crawl-account/crawl_account.service.ts index e33faa7ec..99bfd16f1 100644 --- a/src/services/crawl-account/crawl_account.service.ts +++ b/src/services/crawl-account/crawl_account.service.ts @@ -74,7 +74,7 @@ export default class CrawlAccountService extends BullableService { @QueueHandler({ queueName: BULL_JOB_NAME.CRAWL_ACCOUNT_AUTH, jobName: BULL_JOB_NAME.CRAWL_ACCOUNT_AUTH, - // prefix: `horoscope-v2-${config.chainId}`, + concurrency: config.crawlAccount.crawlAccountAuth.concurrency, }) public async handleJobAccountAuth(_payload: IAddressesParam): Promise { this._lcdClient = await getLcdClient(); @@ -234,7 +234,7 @@ export default class CrawlAccountService extends BullableService { @QueueHandler({ queueName: BULL_JOB_NAME.CRAWL_ACCOUNT_BALANCES, jobName: BULL_JOB_NAME.CRAWL_ACCOUNT_BALANCES, - // prefix: `horoscope-v2-${config.chainId}`, + concurrency: config.crawlAccount.crawlAccountBalance.concurrency, }) public async handleJobAccountBalances( _payload: IAddressesParam @@ -357,7 +357,7 @@ export default class CrawlAccountService extends BullableService { @QueueHandler({ queueName: BULL_JOB_NAME.CRAWL_ACCOUNT_SPENDABLE_BALANCES, jobName: BULL_JOB_NAME.CRAWL_ACCOUNT_SPENDABLE_BALANCES, - // prefix: `horoscope-v2-${config.chainId}`, + concurrency: config.crawlAccount.crawlAccountSpendableBalance.concurrency, }) public async handleJobAccountSpendableBalances( _payload: IAddressesParam @@ -534,7 +534,6 @@ export default class CrawlAccountService extends BullableService { @QueueHandler({ queueName: BULL_JOB_NAME.HANDLE_VESTING_ACCOUNT, jobName: BULL_JOB_NAME.HANDLE_VESTING_ACCOUNT, - // prefix: `horoscope-v2-${config.chainId}`, }) public async handleVestingAccounts(_payload: object): Promise { const addresses: string[] = [];