Skip to content

Commit 2d75caa

Browse files
committed
Use graph interval as refresh interval, within limits
1 parent 26712ca commit 2d75caa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

embed.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,16 @@
174174
graph_resize();
175175
graph_reload();
176176

177-
// automatic refresh
177+
// automatic refresh every 60s < interval < 1 day
178+
var refresh = Math.min(Math.max(60, view.interval), 86400);
178179
window.setInterval(function() {
179180
if (floatingtime) {
180181
$('.graph_time_refresh').click();
181182
}
182183
else {
183184
graph_reload();
184185
}
185-
}, 60000);
186+
}, refresh * 1000); // ms
186187
}
187188
});
188189

0 commit comments

Comments
 (0)