mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Created general driver to accept an argument select the driver to run. * Added environment variable for driver, changed package.json to use custim leadfoot, and made changes to browserdriver to use any driver. * Made changes per PR. * Fixed all nits.
16 lines
357 B
JavaScript
16 lines
357 B
JavaScript
import request from 'request';
|
|
import { fromNode as fcb } from 'bluebird';
|
|
|
|
export async function ping(url) {
|
|
try {
|
|
await Promise.race([
|
|
fcb(cb => request(url, cb)),
|
|
new Promise((resolve, reject) => {
|
|
setTimeout(() => reject(new Error('timeout')), 1000);
|
|
})
|
|
]);
|
|
return true;
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|