feat: use long format for category time stats

This commit is contained in:
Isaac 2023-02-16 21:12:37 +00:00
parent c59343168c
commit 65eb2a3e86
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -419,8 +419,8 @@ module.exports = class TicketManager {
},
});
stats = {
avgResolutionTime: ms(tickets.reduce((total, ticket) => total + (ticket.closedAt - ticket.createdAt), 0) ?? 1 / tickets.length),
avgResponseTime: ms(tickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) ?? 1 / tickets.length),
avgResolutionTime: ms(tickets.reduce((total, ticket) => total + (ticket.closedAt - ticket.createdAt), 0) ?? 1 / tickets.length, { long: true }),
avgResponseTime: ms(tickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) ?? 1 / tickets.length, { long: true }),
};
this.client.keyv.set(statsCacheKey, stats, ms('1h'));
}