From 90d82a778433921f114c961c162852bffb084e31 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Thu, 10 Jun 2021 00:14:43 -0500 Subject: [PATCH] Add ability to refresh app data --- rootfs/standard/var/www/mynode/application_info.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rootfs/standard/var/www/mynode/application_info.py b/rootfs/standard/var/www/mynode/application_info.py index 7f06776e..b7d656c1 100644 --- a/rootfs/standard/var/www/mynode/application_info.py +++ b/rootfs/standard/var/www/mynode/application_info.py @@ -479,10 +479,20 @@ def clear_application_cache(): global mynode_applications 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"): global mynode_applications - if mynode_applications == None: + if need_application_refresh(): initialize_applications() else: update_applications()