1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +03:00

fixed stats_counters on system

This commit is contained in:
Adolfo Gómez García 2022-11-13 03:46:30 +01:00
parent 43458cbf99
commit adec02dc3f
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -119,8 +119,7 @@ class StatsCounters(models.Model):
max_intervals = kwargs.get('max_intervals') or 0 max_intervals = kwargs.get('max_intervals') or 0
if max_intervals > 0: if max_intervals > 0:
count = q.count() count = q.count()
if max_intervals < count: max_intervals = max(min(max_intervals, count), 2)
max_intervals = count
interval = int(to - since) / max_intervals interval = int(to - since) / max_intervals
floor = getSqlFnc('FLOOR') floor = getSqlFnc('FLOOR')