mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-23 00:16:25 +01:00
fix: convert iso-strings from db to date object
This commit is contained in:
parent
60cadaf01c
commit
645a8bce05
@ -22,7 +22,11 @@ import {
|
||||
IMetricsBucket,
|
||||
} from '../../types/model';
|
||||
import { clientRegisterSchema } from './register-schema';
|
||||
import { minutesToMilliseconds, secondsToMilliseconds } from 'date-fns';
|
||||
import {
|
||||
minutesToMilliseconds,
|
||||
parseISO,
|
||||
secondsToMilliseconds,
|
||||
} from 'date-fns';
|
||||
import TTLList = require('./ttl-list');
|
||||
|
||||
export default class ClientMetricsService {
|
||||
@ -352,8 +356,9 @@ export default class ClientMetricsService {
|
||||
count += countObj.yes + countObj.no;
|
||||
});
|
||||
|
||||
this.lastHourList.add(toggles, stop);
|
||||
this.lastMinuteList.add(toggles, stop);
|
||||
const timestamp = typeof stop === 'string' ? parseISO(stop) : stop;
|
||||
this.lastHourList.add(toggles, timestamp);
|
||||
this.lastMinuteList.add(toggles, timestamp);
|
||||
|
||||
this.globalCount += count;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
Loading…
Reference in New Issue
Block a user