stop showing indicators if the data is stale
This commit is contained in:
parent
474af6c4fc
commit
ed14108083
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue