This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Make services async #7
Comments
e.g. WatchMen.prototype.start = function (cb){
var self = this;
self.daemon_status = 1;
function launch (service){
self.ping ({service:service}, function (err, state){
if (err){ console.error (err); }
if (self.daemon_status){
setTimeout(launch, parseInt(state.next_attempt_secs, 10) * 1000, service);
}
});
}
this.services(function (err, services) {
if(err) {
console.log("Exiting: " + err.message);
process.exit();
}
services.forEach(function(service){
if (service.enabled !== false){
launch(service);
}
});
console.log('watchmen monitor started.');
cb();
});
}; |
Yes, resolving dynamically what servers to ping would be nice (so you can keep them in a database and add/remove services while the process is running). Now you have to change the config file and restart the process, what is not as good. |
I see this issue was opened 3 years ago... is this actively maintained? |
@ericelliott Yes, it is. I guess nobody has issued a PR for this yet... If you do, I will happily review it and merge it. |
👍 |
iloire
pushed a commit
that referenced
this issue
Mar 22, 2015
Thanks for raising this issue. This has been Implemented in b8b5bb5 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The way you coded this you need to specify resources in a file. It would be useful to do http calls to get a dynamic list of servers to ping.
The text was updated successfully, but these errors were encountered: