Skip to content

Commit

Permalink
Organise imports with npm lint
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
  • Loading branch information
matthew1001 committed Jun 19, 2023
1 parent 6d12b63 commit f85b2d2
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TerminusModule } from '@nestjs/terminus';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { PrometheusModule } from '@willsoto/nestjs-prometheus';
import { TokensModule } from './tokens/tokens.module';
import { EventStreamModule } from './event-stream/event-stream.module';
import { EventStreamProxyModule } from './eventstream-proxy/eventstream-proxy.module';
import { HealthModule } from './health/health.module';
import { HealthController } from './health/health.controller';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { PrometheusModule } from '@willsoto/nestjs-prometheus';
import { LoggingAndMetricsInterceptor, MetricProviders } from './logging-and-metrics.interceptor';

@Module({
Expand Down
6 changes: 3 additions & 3 deletions src/eventstream-proxy/eventstream-proxy.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import {
WebSocketEx,
WebSocketMessage,
} from '../websocket-events/websocket-events.base';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';
import {
AckMessageData,
ConnectionListener,
EventListener,
WebSocketMessageBatchData,
WebSocketMessageWithId,
} from './eventstream-proxy.interfaces';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';

/**
* Base class for a websocket gateway that listens for and proxies event stream messages.
Expand Down Expand Up @@ -134,7 +134,7 @@ export abstract class EventStreamProxyBase extends WebSocketEventsBase {

// Record metrics
this.metrics.setEventBatchSize(batch.events.length);
let batchIntervalMs = new Date().getTime() - this.mostRecentCompletedBatchTimestamp.getTime();
const batchIntervalMs = new Date().getTime() - this.mostRecentCompletedBatchTimestamp.getTime();
this.logger.log(`Recording batch interval of ${batchIntervalMs} milliseconds`);
this.metrics.observeBatchInterval(batchIntervalMs);

Expand Down Expand Up @@ -215,7 +215,7 @@ export abstract class EventStreamProxyBase extends WebSocketEventsBase {
return;
}

let timeWaitingForACKms =
const timeWaitingForACKms =
new Date().getTime() - this.mostRecentDispatchedBatchTimestamp.getTime();
this.logger.log(`Recording batch ACK interval of ${timeWaitingForACKms} milliseconds`);
this.metrics.observeBatchAckInterval(timeWaitingForACKms);
Expand Down
2 changes: 1 addition & 1 deletion src/eventstream-proxy/eventstream-proxy.gateway.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ConfigService } from '@nestjs/config';
import { EventStreamService } from '../event-stream/event-stream.service';
import { EventStreamProxyGateway } from './eventstream-proxy.gateway';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';
import { EventStreamProxyGateway } from './eventstream-proxy.gateway';

describe('EventStreamProxyGateway', () => {
let gateway: EventStreamProxyGateway;
Expand Down
2 changes: 1 addition & 1 deletion src/eventstream-proxy/eventstream-proxy.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { Logger } from '@nestjs/common';
import { WebSocketGateway } from '@nestjs/websockets';
import { EventStreamService } from '../event-stream/event-stream.service';
import { EventStreamProxyBase } from './eventstream-proxy.base';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';
import { EventStreamProxyBase } from './eventstream-proxy.base';

@WebSocketGateway({ path: '/api/ws' })
export class EventStreamProxyGateway extends EventStreamProxyBase {
Expand Down
2 changes: 1 addition & 1 deletion src/eventstream-proxy/eventstream-proxy.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { EventStreamModule } from '../event-stream/event-stream.module';
import { EventStreamProxyGateway } from './eventstream-proxy.gateway';
import { LoggingAndMetricsInterceptor, MetricProviders } from '../logging-and-metrics.interceptor';
import { EventStreamProxyGateway } from './eventstream-proxy.gateway';

@Module({
imports: [ConfigModule, EventStreamModule],
Expand Down
2 changes: 1 addition & 1 deletion src/logging-and-metrics.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import {
import { Request, Response } from 'express';
import { Observable, throwError } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import { FFRequestIDHeader } from './request-context/constants';
import { Counter, Histogram, Gauge } from 'prom-client';
import {
InjectMetric,
makeCounterProvider,
makeGaugeProvider,
makeHistogramProvider,
} from '@willsoto/nestjs-prometheus';
import { FFRequestIDHeader } from './request-context/constants';

const METRICS_ROUTE = '/metrics';

Expand Down
2 changes: 1 addition & 1 deletion src/tokens/blockchain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { EventStreamReply } from '../event-stream/event-stream.interfaces';
import { getHttpRequestOptions } from '../utils';
import { Context } from '../request-context/request-context.decorator';
import { FFRequestIDHeader } from '../request-context/constants';
import { EthConnectAsyncResponse, EthConnectReturn, IAbiMethod } from './tokens.interfaces';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';
import { EthConnectAsyncResponse, EthConnectReturn, IAbiMethod } from './tokens.interfaces';

export interface RetryConfiguration {
retryBackOffFactor: number;
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/tokens.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { Module } from '@nestjs/common';
import { HttpModule } from '@nestjs/axios';
import { EventStreamProxyModule } from '../eventstream-proxy/eventstream-proxy.module';
import { EventStreamModule } from '../event-stream/event-stream.module';
import { LoggingAndMetricsInterceptor, MetricProviders } from '../logging-and-metrics.interceptor';
import { TokensController } from './tokens.controller';
import { TokensService } from './tokens.service';
import { AbiMapperService } from './abimapper.service';
import { BlockchainConnectorService } from './blockchain.service';
import { LoggingAndMetricsInterceptor, MetricProviders } from '../logging-and-metrics.interceptor';
@Module({
imports: [
HttpModule.register({
Expand Down
2 changes: 1 addition & 1 deletion src/tokens/tokens.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from '../event-stream/event-stream.interfaces';
import { EventStreamService } from '../event-stream/event-stream.service';
import { EventStreamProxyGateway } from '../eventstream-proxy/eventstream-proxy.gateway';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';
import { AbiMapperService } from './abimapper.service';
import { BlockchainConnectorService, RetryConfiguration } from './blockchain.service';
import {
Expand All @@ -50,7 +51,6 @@ import {
TokenType,
} from './tokens.interfaces';
import { TokensService } from './tokens.service';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';

const BASE_URL = 'http://eth';
const CONTRACT_ADDRESS = '0x123456';
Expand Down
2 changes: 1 addition & 1 deletion src/websocket-events/websocket-events.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from '@nestjs/websockets';
import { nanoid } from 'nanoid';
import WebSocket, { Server } from 'ws';
import { LoggingAndMetricsInterceptor } from 'src/logging-and-metrics.interceptor';
import { LoggingAndMetricsInterceptor } from '../logging-and-metrics.interceptor';

const PING_INTERVAL = 5000;

Expand Down

0 comments on commit f85b2d2

Please sign in to comment.