From 5b818dcd68e7aa8d897c0ab9200eb434afcc1586 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Mon, 16 Mar 2020 10:31:37 +0000 Subject: [PATCH] Increase all ajax calls to 5 seconds The default is 2 seconds and this will mean that we are halving traffic for these ajax calls which can only be good for trying to limit queries on the database. I think the user impact on this will likely not be noticable. Debatable whether we should up them all even further to 10 seconds but this is definitely a quick although maybe small win. --- app/templates/components/ajax-block.html | 2 +- app/templates/views/dashboard/dashboard.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/templates/components/ajax-block.html b/app/templates/components/ajax-block.html index 4d40a25b3..c0aa403d8 100644 --- a/app/templates/components/ajax-block.html +++ b/app/templates/components/ajax-block.html @@ -1,4 +1,4 @@ -{% macro ajax_block(partials, url, key, interval=2, finished=False, form='') %} +{% macro ajax_block(partials, url, key, interval=5, finished=False, form='') %} {% if not finished %}
In the last 7 days - {{ ajax_block(partials, updates_url, 'inbox', interval=5) }} + {{ ajax_block(partials, updates_url, 'inbox') }} - {{ ajax_block(partials, updates_url, 'totals', interval=5) }} + {{ ajax_block(partials, updates_url, 'totals') }} {{ show_more( url_for('.monthly', service_id=current_service.id), 'See messages sent per month' ) }} - {{ ajax_block(partials, updates_url, 'template-statistics', interval=5) }} + {{ ajax_block(partials, updates_url, 'template-statistics') }} {% if current_service.immediate_jobs and not current_service.has_permission('upload_letters') %} - {{ ajax_block(partials, updates_url, 'jobs', interval=5) }} + {{ ajax_block(partials, updates_url, 'jobs') }} {{ show_more( url_for('.view_jobs', service_id=current_service.id), 'See all uploaded files'