dbgate/integration-tests/wait.js

24 lines
647 B
JavaScript
Raw Normal View History

2021-05-27 07:26:37 +00:00
const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver');
const engines = require('./engines');
global.DBGATE_TOOLS = require('dbgate-tools');
2021-05-27 07:12:21 +00:00
async function run() {
2021-05-27 07:26:37 +00:00
for (const engine of engines) {
const driver = requireEngineDriver(engine.connection);
for (;;) {
try {
const conn = await driver.connect(engine.connection);
await driver.getVersion(conn);
await driver.close(conn);
break;
} catch (err) {
console.log(`Waiting for ${engine.label}`);
await new Promise(resolve => setTimeout(resolve, 1000));
continue;
}
}
}
2021-05-27 07:12:21 +00:00
}
run();