Website running JavaScript setInterval starts to fail after ~1day

Posted by Martin Clemens Bloch on Stack Overflow See other posts from Stack Overflow or by Martin Clemens Bloch
Published on 2012-11-05T16:48:38Z Indexed on 2012/11/05 17:00 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

I wish I could be more specific here, but unfortunately this might be hard. I basically hope this is some "well"-known timeout or setup issue.

We have a website running an (JS/html - ASP.net project) website overview on a screen at a factory. This screen has no keyboard so it should keep refreshing the page forever - years perhaps (though 1 week might be okay). (It is used by factory workers to see incoming transports etc.)

This all works perfectly; the site continuously updates itself and gets the new correct data. Then, sometimes, in the morning this "overview" screen has no data and the workers have to manually refresh the site using the simple refresh button or F5 - which fixes everything.

I have tried a few things trying to reproduce the error myself including:

  1. Cutting the internet connection and MANY other ways of making it timeout (breakpoints, stopping services etc.).
  2. Setting the refresh time of setInterval to 100ms and letting the site run 3-5 minutes. (normal timer is 1 minute)
  3. setInterval SHOULD run forever according to the internet searching I have done.
  4. Checked that "JavaScript frequency" has not been turned down in power saving settings.

No matter what; the site resumes correct function WITHOUT a refresh as soon as I plug in the internet cable or whatever again - I can't reproduce the error.

The website is dependent on a backend WCF service and project integration, but since the workers are fixing this with a simple refresh I am assuming this has not crashed.

EDIT: The browser I tried to reproduce the error in was IE/win7. I will ask about the factory tomorrow, but I am guessing IE/win? also.

Is setInterval in fact really infinite or is there something else wrong here?

All help much appreciated. 0.5 bitcoin reward for solving answer ;)

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript