Count recent clients in miner report

This commit is contained in:
Ben
2026-06-21 00:02:34 -04:00
parent bc8eba3c49
commit d5c5a90aa6
3 changed files with 27 additions and 2 deletions
@@ -55,7 +55,6 @@ describe('UserAgentReportService', () => {
'client.updatedAt > :activeSince',
expect.objectContaining({ activeSince: expect.any(Date) }),
);
expect(clientRepository.queryBuilder.andWhere).toHaveBeenCalledWith('client.hashRate > 0');
});
it('falls back to the materialized view when no active database clients exist', async () => {
@@ -72,7 +72,6 @@ export class UserAgentReportService {
.addSelect('COALESCE(SUM(client.hashRate), 0)', 'totalHashRate')
.where('client.deletedAt IS NULL')
.andWhere('client.updatedAt > :activeSince', { activeSince })
.andWhere('client.hashRate > 0')
.groupBy('COALESCE(NULLIF(client.userAgent, \'\'), \'Other\')')
.orderBy('"totalHashRate"', 'DESC')
.getRawMany<UserAgentReportView>();