gg-mysql-connector 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -216,6 +216,7 @@ class GGMySQLConnector {
216
216
  user: this.DBInfo.user,
217
217
  password: this.DBInfo.password,
218
218
  });
219
+ this.isConnected = true;
219
220
  await this.createDatabaseIfNotExist(currentConnection);
220
221
  // await currentConnection.end()
221
222
  this.connection = mysql2_1.default.createConnection(Object.assign({}, this.DBInfo));
@@ -244,13 +245,14 @@ class GGMySQLConnector {
244
245
  return result;
245
246
  }
246
247
  waitUntilInitSuccess(interval) {
247
- console.log("wait for database connection . . .");
248
248
  return new Promise((resolve, reject) => {
249
249
  setTimeout(() => {
250
250
  if (this.isConnected === false) {
251
+ console.log(`${this.DBInfo.database} > wait for database connection . . .`);
251
252
  this.waitUntilInitSuccess(interval);
252
253
  }
253
254
  else {
255
+ console.log(`${this.DBInfo.database} > database connectd`);
254
256
  return resolve(true);
255
257
  }
256
258
  }, interval);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-mysql-connector",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -356,6 +356,7 @@ export default class GGMySQLConnector<Main> implements ClassDBInterface<Main> {
356
356
  user: this.DBInfo.user,
357
357
  password: this.DBInfo.password,
358
358
  })
359
+ this.isConnected = true
359
360
  await this.createDatabaseIfNotExist(currentConnection)
360
361
  // await currentConnection.end()
361
362
 
@@ -404,12 +405,15 @@ export default class GGMySQLConnector<Main> implements ClassDBInterface<Main> {
404
405
  return result
405
406
  }
406
407
  waitUntilInitSuccess(interval: number) {
407
- console.log("wait for database connection . . .")
408
408
  return new Promise((resolve, reject) => {
409
409
  setTimeout(() => {
410
410
  if (this.isConnected === false) {
411
+ console.log(
412
+ `${this.DBInfo.database} > wait for database connection . . .`
413
+ )
411
414
  this.waitUntilInitSuccess(interval)
412
415
  } else {
416
+ console.log(`${this.DBInfo.database} > database connectd`)
413
417
  return resolve(true)
414
418
  }
415
419
  }, interval)