Skip to content

Commit e8ad8eb

Browse files
automatically start the engine after connection
1 parent fe62933 commit e8ad8eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cubejs-firebolt-driver/src/FireboltDriver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
7777
testConnectionTimeout?: number,
7878
} = {},
7979
) {
80-
super(config);
80+
// Set connection timeout to 2 minutes to allow the engine to start if it's stopped
81+
super({testConnectionTimeout: 120000, ...config});
8182

8283
const dataSource =
8384
config.dataSource ||
@@ -122,6 +123,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
122123
private async initConnection() {
123124
try {
124125
const connection = await this.firebolt.connect(this.config.connection);
126+
await this.ensureEngineRunning();
125127
return connection;
126128
} catch (e) {
127129
this.connection = null;
@@ -174,7 +176,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
174176
await connection.testConnection();
175177
} catch (error) {
176178
console.log(error);
177-
throw new Error('Unable to connect');
179+
throw error;
178180
}
179181
}
180182

0 commit comments

Comments
 (0)