Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function server_ping(retries=3) {
if(retries <= 0) {
return false;
}
var success = null;
mc.ping({}, function(err, results) {
success = !err;
});
sleep(1000);
if(!success) {
success = server_ping(retries - 1);
}
return success;
}