Add ability to refresh app data

This commit is contained in:
Taylor Helsper 2021-06-10 00:14:43 -05:00
parent 711070f414
commit 90d82a7784

View File

@ -479,10 +479,20 @@ def clear_application_cache():
global mynode_applications global mynode_applications
mynode_applications = None mynode_applications = None
def need_application_refresh():
global mynode_applications
if mynode_applications == None:
return True
if os.path.isfile("/tmp/need_application_refresh"):
os.system("rm /tmp/need_application_refresh")
os.system("sync")
return True
return False
def get_all_applications(order_by="none"): def get_all_applications(order_by="none"):
global mynode_applications global mynode_applications
if mynode_applications == None: if need_application_refresh():
initialize_applications() initialize_applications()
else: else:
update_applications() update_applications()