You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I order a larger number of instances, sometimes, the pinger throws this error: new Error('[ping] should have hostname and port'); making the overall program to restart.
Here is a suggestion for the pinger:
`
if (!options || !options.hostname || !options.port) {
winston.debug('[Pinger] ping: null / null ');
return new Promise((resolve, reject) => {
return reject('[ping] should have hostname and port');
});
}else{
winston.debug('[Pinger] ping: hostname=%s / port=%d', options.hostname, options.port);
const opts = {
method: 'GET',
url: `http://${options.hostname}:${options.port}/ping`,
timeout: options.timeout || 5000, // Set default timeout to 5s
};
return new Promise((resolve, reject) => {
request(opts, (err, res, body) => {
if (err) {
return reject(err);
}
if (res.statusCode !== 200) {
return reject(body);
}
return resolve(body);
});
});
}
`
What do you think ?
Best,
Anis
The text was updated successfully, but these errors were encountered:
Hello,
When I order a larger number of instances, sometimes, the pinger throws this error: new Error('[ping] should have hostname and port'); making the overall program to restart.
Here is a suggestion for the pinger:
`
`
What do you think ?
Best,
Anis
The text was updated successfully, but these errors were encountered: