caching only if some meals were found last time

Signed-off-by: Konrad <klux2@hs-mittweida.de>
This commit is contained in:
Konrad 2019-09-27 21:02:10 +02:00
parent e9cac9429b
commit a751903eee

View file

@ -249,7 +249,7 @@ async def get_essen(only_today: bool) -> None:
:return:
"""
global datum, essen, essen_eng, var, last_updated # , ctx
if time() < last_updated + 900:
if time() < last_updated + 30 or (len(essen) > 0 and time() < last_updated + 900):
return
last_updated = time()