async_on_scroll: false, // sync/async onscroll handler
onscroll_worker_duration_threshold: 30, // time in ms, to consider slow the onscroll handler
+ retries_on_data_failures: 3, // how many retries to make if we can't fetch chart data from the server
+
setOptionCallback: function() { ; }
},
// the chart library requested by the user
this.library_name = self.data('chart-library') || NETDATA.chartDefaults.library;
+ // how many retries we have made to load chart data from the server
+ this.retries_on_data_failures = 0;
+
// object - the chart library used
this.library = null;
})
.done(function(data) {
that.xhr = undefined;
+ that.retries_on_data_failures = 0;
if(that.debug === true)
that.log('data received. updating chart.');
.fail(function(msg) {
that.xhr = undefined;
- if(msg.statusText !== 'abort')
- error('data download failed for url: ' + that.data_url);
+ if(msg.statusText !== 'abort') {
+ that.retries_on_data_failures++;
+ if(that.retries_on_data_failures > NETDATA.options.current.retries_on_data_failures) {
+ // that.log('failed ' + that.retries_on_data_failures.toString() + ' times - giving up');
+ that.retries_on_data_failures = 0;
+ error('data download failed for url: ' + that.data_url);
+ }
+ else {
+ that.tm.last_autorefreshed = Date.now();
+ // that.log('failed ' + that.retries_on_data_failures.toString() + ' times, but I will retry');
+ }
+ }
})
.always(function() {
that.xhr = undefined;
and that you have chown it to be owned by netdata:netdata
-->
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
-<script type="text/javascript" src="dashboard.js?v20161218-1"></script>
+<script type="text/javascript" src="dashboard.js?v20161219-1"></script>
<script>
// --- OPTIONS FOR THE CHARTS --
// since we have many servers and limited sockets,
// abort ajax calls when we scroll
NETDATA.options.current.abort_ajax_on_scroll = true;
+
+ // do not to give errors on netdata demo servers for 60 seconds
+ NETDATA.options.current.retries_on_data_failures = 60;
</script>
<style>
});
if(isdemo()) {
+ // do not to give errors on netdata demo servers for 60 seconds
+ NETDATA.options.current.retries_on_data_failures = 60;
+
if(urlOptions.nowelcome !== true) {
setTimeout(function() {
$('#welcomeModal').modal();
</div>
</body>
</html>
-<script type="text/javascript" src="dashboard.js?v20161218-5"></script>
+<script type="text/javascript" src="dashboard.js?v20161219-1"></script>