diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index dddd9ff5..1eeaefc5 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -3,13 +3,7 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route changes etc then back here in order lowest level first as affects the most stuff exponentially so best to do it early =-=-=-=- -todo: does Duplicate code really duplicate the tags? - i.e. duplicate a widget with tags, do the tags come over? - if not then need to modify the copy object code to handle tags as well -todo: readonly on all forms make sure it's ok, because on customize form I see no save but can edit - - (logged in as bizadminlimited) -todo: read only version of duration, datetime, date, time, currency todo: help links for individual extensions (does this refer to the new plugins?)? (button I guess since no menu on them) todo: rockfish, can't do purchase for raven or view it I think diff --git a/ayanova/src/api/notifypoll.js b/ayanova/src/api/notifypoll.js index a75929bb..ae4dfe21 100644 --- a/ayanova/src/api/notifypoll.js +++ b/ayanova/src/api/notifypoll.js @@ -1,7 +1,8 @@ /* xeslint-disable */ let keepChecking = false; -const DEFAULT_POLLING_INTERVAL = 60000; +const DEFAULT_POLLING_INTERVAL = window.$gz.dev ? 20000 : 60000; + //const DEFAULT_POLLING_INTERVAL = 5000; const MAX_POLLING_INTERVAL = 10 * 60 * 1000; //10 minutes maximum wait time @@ -11,7 +12,8 @@ export default { return; } keepChecking = true; - let pollingInterval = window.$gz.dev ? 20000 : DEFAULT_POLLING_INTERVAL; + //initial delay so it fetchs "immediately" + let pollingInterval = 3000; let status = null; while (keepChecking == true) { try { @@ -23,12 +25,16 @@ export default { } else { window.$gz.store.commit("setNewNotificationCount", status.data); //success so go to default in case it was changed by an error - pollingInterval = window.$gz.dev ? 20000 : DEFAULT_POLLING_INTERVAL; + pollingInterval = DEFAULT_POLLING_INTERVAL; } } else { keepChecking = false; } } catch (error) { + //fixup if fails on very first iteration with initial short polling interval + if (pollingInterval < DEFAULT_POLLING_INTERVAL) { + pollingInterval = DEFAULT_POLLING_INTERVAL; + } pollingInterval *= 1.5; if (pollingInterval > MAX_POLLING_INTERVAL) { pollingInterval = MAX_POLLING_INTERVAL;