Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async pingDb(connection: MongoClient, timeout: number) {
const promise =
connection.isConnected() ? Promise.resolve() : Promise.reject();
return await promiseTimeout(timeout, promise);
}