stop showing indicators if the data is stale

This commit is contained in:
Gwendolyn 2024-12-29 22:17:49 +01:00
parent 474af6c4fc
commit ed14108083

View file

@ -450,6 +450,9 @@ def get_load(request):
if result is not None: if result is not None:
return result return result
if not cache.get('mapdata:load_is_recent', False):
return {}
load_groups = {g.pk: g for g in LoadGroup.objects.all()} load_groups = {g.pk: g for g in LoadGroup.objects.all()}
# per group # per group
@ -518,5 +521,6 @@ def post_load(request, parameters: ApLoadSchema):
beacon.save() beacon.save()
cache.delete('mapdata:get_load') cache.delete('mapdata:get_load')
cache.set('mapdata:load_is_recent', True, 300)
return 204, None return 204, None