Skip to content

Commit ba0b275

Browse files
committed
linter
1 parent e8bed5c commit ba0b275

4 files changed

Lines changed: 15 additions & 19 deletions

File tree

src/index.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class HawkAPI {
149149
/**
150150
* Creates factories to work with models
151151
* @param dataLoaders - dataLoaders for fetching data form database
152+
* @returns factories object
152153
*/
153154
private static setupFactories(dataLoaders: DataLoaders): ContextFactories {
154155
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -213,21 +214,18 @@ class HawkAPI {
213214

214215
/**
215216
* Initializing accounting SDK
216-
*/
217-
let tlsVerify;
218-
219-
/**
220217
* Checking env variables
221218
* If at least one path is not transmitted, the variable tlsVerify is undefined
222219
*/
223220
if (
224221
![process.env.TLS_CA_CERT, process.env.TLS_CERT, process.env.TLS_KEY].some(value => value === undefined || value.length === 0)
225222
) {
226-
tlsVerify = {
227-
tlsCaCertPath: `${process.env.TLS_CA_CERT}`,
228-
tlsCertPath: `${process.env.TLS_CERT}`,
229-
tlsKeyPath: `${process.env.TLS_KEY}`,
230-
};
223+
// tlsVerify is used for accounting SDK (currently commented out)
224+
// const tlsVerify = {
225+
// tlsCaCertPath: `${process.env.TLS_CA_CERT}`,
226+
// tlsCertPath: `${process.env.TLS_CERT}`,
227+
// tlsKeyPath: `${process.env.TLS_KEY}`,
228+
// };
231229
}
232230

233231
/*
@@ -253,11 +251,12 @@ class HawkAPI {
253251
public async start(): Promise<void> {
254252
await mongo.setupConnections();
255253
await rabbitmq.setupConnections();
256-
254+
257255
// Initialize Redis singleton with auto-reconnect
258256
const redis = RedisHelper.getInstance();
257+
259258
await redis.initialize();
260-
259+
261260
await this.server.start();
262261
this.app.use(graphqlUploadExpress());
263262
this.server.applyMiddleware({ app: this.app });

src/models/eventsFactory.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { getMidnightWithTimezoneOffset, getUTCMidnight } from '../utils/dates';
22
import safe from 'safe-regex';
33
import { createProjectEventsByIdLoader } from '../dataLoaders';
4-
import { Effect, sgr } from '../utils/ansi';
4+
import RedisHelper from '../redisHelper';
5+
import ChartDataService from '../services/chartDataService';
56

67
const Factory = require('./modelFactory');
78
const mongo = require('../mongo');
89
const Event = require('../models/event');
910
const { ObjectID } = require('mongodb');
10-
import RedisHelper from '../redisHelper';
11-
import ChartDataService from '../services/chartDataService';
1211
const { composeEventPayloadByRepetition } = require('../utils/merge');
1312

1413
const MAX_DB_READ_BATCH_SIZE = Number(process.env.MAX_DB_READ_BATCH_SIZE);

src/redisHelper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import HawkCatcher from '@hawk.so/nodejs';
22
import { createClient, RedisClientType } from 'redis';
3-
import { Effect, sgr } from './utils/ansi';
43

54
/**
65
* Helper class for working with Redis

src/utils/chartStorageKeys.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Utilities for composing Redis TimeSeries keys for chart data storage
3-
*
3+
*
44
* Note: Event-level metrics use MongoDB only (not Redis TimeSeries)
55
* Only project-level metrics are stored in Redis TimeSeries
66
*/
@@ -43,8 +43,7 @@ export function getTimeSeriesSuffix(groupBy: number): string {
4343
} else if (groupBy === 1440) {
4444
return 'daily';
4545
}
46-
46+
4747
// For custom intervals, fallback to minutely with aggregation
4848
return 'minutely';
49-
}
50-
49+
}

0 commit comments

Comments
 (0)