diff --git a/apps/dashboard/app/javascript/config.js b/apps/dashboard/app/javascript/config.js index aa1efea705..fd9c0f3072 100644 --- a/apps/dashboard/app/javascript/config.js +++ b/apps/dashboard/app/javascript/config.js @@ -73,6 +73,11 @@ export function bcIndexUrl() { return cfgData['bcIndexUrl']; } +export function statusPollDelay() { + const cfgData = configData(); + return Number(cfgData['statusPollDelay']); +} + export function statusIndexUrl() { const cfgData = configData(); return cfgData['statusIndexUrl']; diff --git a/apps/dashboard/app/javascript/system_status.js b/apps/dashboard/app/javascript/system_status.js index 823b125c3b..531abb73b6 100644 --- a/apps/dashboard/app/javascript/system_status.js +++ b/apps/dashboard/app/javascript/system_status.js @@ -1,7 +1,6 @@ -import { statusIndexUrl } from './config' +import { statusIndexUrl, statusPollDelay } from './config' import { pollAndReplace } from './turbo_shim' jQuery(() => { - pollDelay = 30000; - pollAndReplace(statusIndexUrl(), pollDelay, "system-status"); -}) \ No newline at end of file + pollAndReplace(statusIndexUrl(), statusPollDelay(), "system-status"); +}); \ No newline at end of file diff --git a/apps/dashboard/app/views/layouts/_config.html.erb b/apps/dashboard/app/views/layouts/_config.html.erb index ba2713118a..c79ed77614 100644 --- a/apps/dashboard/app/views/layouts/_config.html.erb +++ b/apps/dashboard/app/views/layouts/_config.html.erb @@ -9,5 +9,6 @@ data-base-analytics-path="<%= analytics_path('delme').gsub(/[\/]*delme[\/]*/,'') %>" data-bc-poll-delay="<%= Configuration.bc_sessions_poll_delay %>" data-bc-index-url="<%= batch_connect_sessions_path %>" + data-status-poll-delay="<%= Configuration.status_poll_delay %>" data-status-index-url="<%= system_status_path %>" > diff --git a/apps/dashboard/config/configuration_singleton.rb b/apps/dashboard/config/configuration_singleton.rb index ec691c43d1..4f4b0cd05c 100644 --- a/apps/dashboard/config/configuration_singleton.rb +++ b/apps/dashboard/config/configuration_singleton.rb @@ -377,6 +377,14 @@ def ood_bc_card_time (ood_bc_card_time_int < 0) ? 0 : ood_bc_card_time_int end + # Returns the number of milliseconds to wait between calls to the system status page + # The default is 30s and the minimum is 10s. + def status_poll_delay + status_poll_delay = ENV['STATUS_POLL_DELAY'] + status_poll_delay_int = status_poll_delay.nil? ? config.fetch(:status_delay, '30000').to_i : status_poll_delay.to_i + status_poll_delay_int < 10_000 ? 10_000 : status_poll_delay_int + end + # Returns the number of milliseconds to wait between calls to the BatchConnect Sessions resource # to update the sessions card information. # The default and minimum value is 10s = 10_000