retry page stats in 5 seconds if they fail
diff --git a/planetstack/core/static/page_analytics.js b/planetstack/core/static/page_analytics.js
index 6f35b6b..0b1357b 100644
--- a/planetstack/core/static/page_analytics.js
+++ b/planetstack/core/static/page_analytics.js
@@ -58,12 +58,15 @@
url: url,
dataType : 'json',
type : 'GET',
- success: function(newData)
- {
+ success: function(newData) {
updatePageAnalyticsData(newData);
+ setTimeout(updatePageAnalytics, 30000);
+ },
+ error: function() {
+ console.log("error retrieving statistics; retry in 5 seconds");
+ setTimeout(updatePageBandwidth, 5000);
}
});
- setTimeout(updatePageAnalytics, 30000);
}
// ----------------------------------------------------------------------------
@@ -87,12 +90,15 @@
url : url,
dataType : 'json',
type : 'GET',
- success: function(newData)
- {
+ success: function(newData) {
updatePageBandwidthData(newData);
+ setTimeout(updatePageBandwidth, 30000);
+ },
+ error: function() {
+ console.log("error retrieving statistics; retry in 5 seconds")
+ setTimeout(updatePageBandwidth, 5000);
}
});
- setTimeout(updatePageBandwidth, 30000);
}
$( document ).ready(function() {