Bug fix for checking if caches is expired

This commit is contained in:
Scott Idem
2025-05-02 10:58:15 -04:00
parent 77c53065bc
commit 8f515e034b

View File

@@ -224,7 +224,8 @@ if (!$ae_loc?.last_cache_refresh) { // Default is null, currently...
console.log(`ROOT: Last diff: ${Date.now() - $ae_loc?.last_cache_refresh}`); console.log(`ROOT: Last diff: ${Date.now() - $ae_loc?.last_cache_refresh}`);
} }
if ($ae_loc?.manager_access && (Date.now() - $ae_loc?.last_cache_refresh) > manager_refresh_time) { if ($ae_loc?.manager_access) {
if ((Date.now() - $ae_loc?.last_cache_refresh) > manager_refresh_time) {
console.log(`ROOT: Last (manager) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`); console.log(`ROOT: Last (manager) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`);
flag_clear_idb = true; flag_clear_idb = true;
@@ -235,7 +236,9 @@ if (!$ae_loc?.last_cache_refresh) { // Default is null, currently...
$ae_loc.cache_expired = true; $ae_loc.cache_expired = true;
$ae_loc.allow_access = false; $ae_loc.allow_access = false;
} else if ($ae_loc?.trusted_access && (Date.now() - $ae_loc?.last_cache_refresh) > trusted_refresh_time) { }
} else if ($ae_loc?.trusted_access) {
if ((Date.now() - $ae_loc?.last_cache_refresh) > trusted_refresh_time) {
console.log(`ROOT: Last (trusted) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`); console.log(`ROOT: Last (trusted) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`);
flag_clear_idb = true; flag_clear_idb = true;
@@ -246,7 +249,9 @@ if (!$ae_loc?.last_cache_refresh) { // Default is null, currently...
$ae_loc.cache_expired = true; $ae_loc.cache_expired = true;
$ae_loc.allow_access = false; $ae_loc.allow_access = false;
} else if ($ae_loc?.authenticated_access && (Date.now() - $ae_loc?.last_cache_refresh) > authenticated_refresh_time) { }
} else if ($ae_loc?.authenticated_access) {
if ((Date.now() - $ae_loc?.last_cache_refresh) > authenticated_refresh_time) {
console.log(`ROOT: Last (authenticated) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`); console.log(`ROOT: Last (authenticated) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`);
flag_clear_idb = true; flag_clear_idb = true;
@@ -257,6 +262,7 @@ if (!$ae_loc?.last_cache_refresh) { // Default is null, currently...
$ae_loc.cache_expired = true; $ae_loc.cache_expired = true;
$ae_loc.allow_access = false; $ae_loc.allow_access = false;
}
} else if ((Date.now() - $ae_loc?.last_cache_refresh) > default_refresh_time) { } else if ((Date.now() - $ae_loc?.last_cache_refresh) > default_refresh_time) {
console.log(`ROOT: Last (default) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`); console.log(`ROOT: Last (default) local config reload too old for all caches: ${$ae_loc.last_cache_refresh}`);