enterprise: bump license usage task frequency (#7215)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-10-18 14:57:35 +02:00
committed by GitHub
parent 35147230d7
commit 6ba4f4df46
3 changed files with 5 additions and 3 deletions

View File

@ -136,6 +136,9 @@ class LicenseKey:
def record_usage(self):
"""Capture the current validity status and metrics and save them"""
threshold = now() - timedelta(hours=8)
if LicenseUsage.objects.filter(record_date__gte=threshold).exists():
return
LicenseUsage.objects.create(
user_count=self.get_default_user_count(),
external_user_count=self.get_external_user_count(),