ChaoticWeg / slack-rangersbot

Watches the Rangers so you don't have to
http://chaoticweg.cc/slack-rangersbot
GNU General Public License v3.0
0 stars 0 forks source link

Not sure whether Watcher's tick interval is ever stopped... #5

Open ChaoticWeg opened 7 years ago

ChaoticWeg commented 7 years ago

So, of course the process bails whenever the Node process exits or is stopped. But if the Watcher is stopped without the process bailing, I'm not sure if the keep-alive tick ever stops going.

Relevant source code

Since the ticker relies on setInterval instead of setTimeout, it needs to be cleared with clearInterval to stop it. But in tick(), if the watcher is in a stopped state, there is nothing that causes the watcher to actually stop -- no call to stop(), no clearInterval, nothing.