How Important is Keeping Eventloop Blockness Low?

I started looking at Kadira’s guides and saw this on Eventloop Blockness. When I started using Kadira I noticed that my Eventloop Blockness would idle at about 90%. Below is the code I’m using that causes this. It’s a few setTimeout and setInterval functions in order to refresh the access token for Spotify. I wouldn’t think this would be a big deal but 90% seems very high. How important is it to keep the Eventlook Blockness low? Will this code block other code eventually?

tokenRefresher = function (interval) {
/*if (interval) {
//If the interval is passed, refresh the token on a 59 minute interval
setInterval(Meteor.call(‘refreshDatToken’, Meteor.user()._id), interval);
console.log(‘Refresh interval set for 59 minutes…’);
} else {
//No interval passed. Let’s see how long we have left until the token expires
var difference = Meteor.user().services.spotify.expiresAt - (Date.now() / 1000);
console.log('Time to expire: ’ + difference);

//Calculate the setTimeout value. Put difference into ms and then subtract 5s
var ms = (difference * 1000) - 5000;

//Refresh token in ms, then set the interval for 59 minutes.
console.log('Setting token to refresh in ' + ms + ' milliseconds...');
setTimeout(function () {
  Meteor.call('refreshDatToken');
  setInterval(Meteor.call('refreshDatToken'), 3540000);
}, ms);

}*/
};

what about:

  • this.unblock() in that refreshDatToken method
  • and use synced-cron to schedule refreshing

if you really need it to be refreshed all the time and not just when request arrive

I though synced-cron can only be run on the server? The way I have it now, the refresh is on the client. Sorry, should have specified that earlier.