This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Force reload?
#9
Hi,

If you have a lot of clients you could add a random delay to divide all request to the controller at once by using this:

Code:
$(function(){
if (typeof grp != 'undefined') {
  grp.listen('1/1/1', function(object, state) {
    var value = object.value;
    if (state == 'value') {
      if (value == 1) {
        var x = Math.floor((Math.random() * 10000) + 1);
        setTimeout(function(){
           location.reload();
        }, x);
        grp.update('1/1/1', false);
      }
    }
  }, true);
}
});
BR,

Erwin
Reply


Messages In This Thread
Force reload? - by Thomas - 06.02.2017, 16:56
RE: Force reload? - by Erwin van der Zwart - 06.02.2017, 17:08
RE: Force reload? - by Thomas - 06.02.2017, 17:12
RE: Force reload? - by Erwin van der Zwart - 06.02.2017, 17:20
RE: Force reload? - by Thomas - 07.02.2017, 11:40
RE: Force reload? - by Thomas - 08.05.2018, 10:56
RE: Force reload? - by Erwin van der Zwart - 08.05.2018, 11:48
RE: Force reload? - by admin - 08.05.2018, 12:48
RE: Force reload? - by Erwin van der Zwart - 08.05.2018, 15:53

Forum Jump: