Skip to content
Snippets Groups Projects
Commit 6c07e092 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

feat/us757-dacc-0-monthly-connections

parent 2769ad37
No related branches found
No related tags found
2 merge requests!610chore(release): 1.9.3,!596feat/us757-dacc-0-monthly-connections
......@@ -605,25 +605,26 @@ const sendConnectionCount = async (client: Client) => {
},
})
let uniqueDates = 0
// If there is at least one connection, filter each unique connection in order to send it
if (events.length > 0) {
const uniqueDates = events
uniqueDates = events
.map(s => s.eventDate.day)
.filter((s, i, a) => a.indexOf(s) == i)
.filter((s, i, a) => a.indexOf(s) == i).length
}
const connectionMonthly: Indicator = {
createdBy: 'ecolyo',
measureName: DaccEvent.CONNECTION_COUNT_MONTHLY,
startDate: DateTime.local()
.setZone('utc', {
keepLocalTime: true,
})
.startOf('day')
.toISODate(),
value: uniqueDates.length,
}
await sendIndicator(connectionMonthly, client)
const connectionMonthly: Indicator = {
createdBy: 'ecolyo',
measureName: DaccEvent.CONNECTION_COUNT_MONTHLY,
startDate: DateTime.local()
.setZone('utc', {
keepLocalTime: true,
})
.startOf('day')
.toISODate(),
value: uniqueDates,
}
await sendIndicator(connectionMonthly, client)
}
const sendProfileCount = async (client: Client) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment