Skip to content

Commit 57b8de7

Browse files
committed
fix for pr comments
1 parent 2bfe2b8 commit 57b8de7

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

src/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,6 @@ class HawkAPI {
217217
* Checking env variables
218218
* If at least one path is not transmitted, the variable tlsVerify is undefined
219219
*/
220-
if (
221-
![process.env.TLS_CA_CERT, process.env.TLS_CERT, process.env.TLS_KEY].some(value => value === undefined || value.length === 0)
222-
) {
223-
/*
224-
* tlsVerify is used for accounting SDK (currently commented out)
225-
* const tlsVerify = {
226-
* tlsCaCertPath: `${process.env.TLS_CA_CERT}`,
227-
* tlsCertPath: `${process.env.TLS_CERT}`,
228-
* tlsKeyPath: `${process.env.TLS_KEY}`,
229-
* };
230-
*/
231-
}
232-
233220
/*
234221
* const accounting = new Accounting({
235222
* baseURL: `${process.env.CODEX_ACCOUNTING_URL}`,

src/utils/chartStorageKeys.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ export function composeProjectMetricsKey(
3636
* @returns suffix string (minutely, hourly, daily)
3737
*/
3838
export function getTimeSeriesSuffix(groupBy: number): string {
39-
if (groupBy === 1) {
40-
return 'minutely';
41-
} else if (groupBy === 60) {
42-
return 'hourly';
43-
} else if (groupBy === 1440) {
44-
return 'daily';
39+
switch (groupBy) {
40+
case 1:
41+
return 'minutely';
42+
case 60:
43+
return 'hourly';
44+
case 1440:
45+
return 'daily';
46+
default:
47+
// For custom intervals, fallback to minutely with aggregation
48+
return 'minutely';
4549
}
46-
47-
// For custom intervals, fallback to minutely with aggregation
48-
return 'minutely';
4950
}

0 commit comments

Comments
 (0)