mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
24 lines
647 B
JavaScript
24 lines
647 B
JavaScript
const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver');
|
|
const engines = require('./engines');
|
|
global.DBGATE_TOOLS = require('dbgate-tools');
|
|
|
|
async function run() {
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
run();
|