diff --git a/.github/workflows/indexer-build-and-push-dev-staging.yml b/.github/workflows/indexer-build-and-push-dev-staging.yml index 5574f2ba02..5a98b72552 100644 --- a/.github/workflows/indexer-build-and-push-dev-staging.yml +++ b/.github/workflows/indexer-build-and-push-dev-staging.yml @@ -3,7 +3,7 @@ name: Indexer Build & Push Images to AWS ECR for Dev / Staging branches on: # yamllint disable-line rule:truthy push: branches: - - 'wl/t3' + - main - 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x - 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x # TODO(DEC-837): Customize github build and push to ECR by service with paths diff --git a/.github/workflows/indexer-build-and-push-mainnet.yml b/.github/workflows/indexer-build-and-push-mainnet.yml index 6629cfc63c..78d54d2f68 100644 --- a/.github/workflows/indexer-build-and-push-mainnet.yml +++ b/.github/workflows/indexer-build-and-push-mainnet.yml @@ -3,7 +3,6 @@ name: Indexer Build & Push Images to AWS ECR for Mainnet on: # yamllint disable-line rule:truthy push: branches: - - 'wl/t3' - main - 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x - 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x diff --git a/indexer/services/socks/src/lib/message-forwarder.ts b/indexer/services/socks/src/lib/message-forwarder.ts index cd00fb34fd..852238a0b1 100644 --- a/indexer/services/socks/src/lib/message-forwarder.ts +++ b/indexer/services/socks/src/lib/message-forwarder.ts @@ -1,41 +1,23 @@ // import { Worker } from 'worker_threads'; import path from 'path'; -import { - stats, - logger, - InfoObject, -} from '@dydxprotocol-indexer/base'; -import { updateOnMessageFunction } from '@dydxprotocol-indexer/kafka'; -import { perpetualMarketRefresher } from '@dydxprotocol-indexer/postgres'; -import { KafkaMessage } from 'kafkajs'; +import { InfoObject, logger, stats } from '@dydxprotocol-indexer/base'; import { updateOnBatchFunction, updateOnMessageFunction } from '@dydxprotocol-indexer/kafka'; -import { - Batch, - EachBatchPayload, - KafkaMessage, -} from 'kafkajs'; +import { perpetualMarketRefresher } from '@dydxprotocol-indexer/postgres'; +import { Batch, EachBatchPayload, KafkaMessage } from 'kafkajs'; import _ from 'lodash'; import Piscina from 'piscina'; import config from '../config'; -import { - createChannelDataMessage, - createChannelBatchDataMessage, -} from '../helpers/message'; +import { createChannelBatchDataMessage, createChannelDataMessage } from '../helpers/message'; import { sendMessage } from '../helpers/wss'; import { - MessageToForward, - Channel, - SubscriptionInfo, - Connection, + Channel, Connection, MessageToForward, SubscriptionInfo, } from '../types'; import { Index } from '../websocket/index'; import { MAX_TIMEOUT_INTEGER } from './constants'; import { Subscriptions } from './subscription'; -import getMessagesToForward, { - getChannels, -} from './workers/from-kafka-helpers'; +import getMessagesToForward, { getChannels } from './workers/from-kafka-helpers'; const piscina = new Piscina({ filename: path.resolve(__dirname, 'workers/blank-worker.js'), @@ -69,7 +51,8 @@ export class MessageForwarder { this.started = false; this.stopped = false; this.messageBuffer = {}; - this.batchSending = setTimeout(() => {}, MAX_TIMEOUT_INTEGER); + this.batchSending = setTimeout(() => { + }, MAX_TIMEOUT_INTEGER); } public start(): void { @@ -99,7 +82,9 @@ export class MessageForwarder { this.started = true; this.batchSending = setInterval( - () => { this.forwardBatchedMessages(); }, + () => { + this.forwardBatchedMessages(); + }, BATCH_SEND_INTERVAL_MS, ); } @@ -328,7 +313,7 @@ export class MessageForwarder { // Buffer messages if the subscription is for batched messages if (this.subscriptions.batchedSubscriptions[message.channel] && - this.subscriptions.batchedSubscriptions[message.channel][message.id]) { + this.subscriptions.batchedSubscriptions[message.channel][message.id]) { const bufferKey: string = this.getMessageBufferKey( message.channel, message.id,