title: setInterval Stops After An Hour With Electron
body: <p>Hoping someone can point me in the right direction here.  My electron app needs to perform an API call every 10 minutes or so. I currently do this using a setInterval loop in the renderer process that fires every 10 minutes.</p>
  
  <p>It generally works fine, for a few hours before it seems to just stop firing. I have several processes that clear and restart the setInterval to try and counteract the problem, but nothing seems to work. </p>
  
  <p>The app opens new browser windows and displays content, which mean the main window may not be in focus all the time, which I suspect may have something to do with it.</p>
  
  <p>I have tried adding</p>
  
  <pre><code>powerSaveBlocker.start("prevent-display-sleep");
  powerSaveBlocker.start("prevent-app-suspension");
  </code></pre>
  
  <p>to my main electron js script, but it doesn't seem to have an effect. The problem is mostly being displayed on Windows machines.  I'm not entirely sure if it happens on Mac or Linux.</p>
  
  <p>So my question, is there any reason why this would be happening that intervals just die after a point? The powerSaveBlocker calls made sense to me, but they don't really seem to do anything. </p>
  
  <p>Or is there a better way to have a background process running at intervals that can perform these API calls? I had looked at <code>node-schedule</code> but I'm not sure if it will fix this issue.</p>