Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
dydxwill committed Jul 9, 2024
1 parent 98b2593 commit 181eb2c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/indexer-build-and-push-dev-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/indexer-build-and-push-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 12 additions & 27 deletions indexer/services/socks/src/lib/message-forwarder.ts
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -99,7 +82,9 @@ export class MessageForwarder {

this.started = true;
this.batchSending = setInterval(
() => { this.forwardBatchedMessages(); },
() => {
this.forwardBatchedMessages();
},
BATCH_SEND_INTERVAL_MS,
);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 181eb2c

Please sign in to comment.