doomiwork 3.1.0 → 3.2.0

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.
@@ -46,15 +46,13 @@ class Database {
46
46
  let that = this;
47
47
  return new Promise((success, failed) => {
48
48
  if (!this.pool) {
49
- that.logError(null,'无可用数据库链接池')
50
- return failed(apiResult.DB_CONNECTED_FAILED);
49
+ return success(apiResult.DB_CONNECTED_FAILED);
51
50
  }
52
51
  ///创建出数据库连接,准备执行
53
52
  this.pool.getConnection(function (err, connection) {
54
53
  if (err) {
55
54
  logger.error("Database Connected Failed :"+ err);
56
- that.logError(null, '数据库连接错误:' + err)
57
- return failed(apiResult.DB_CONNECTED_FAILED);
55
+ return success(apiResult.DB_CONNECTED_FAILED);
58
56
  }
59
57
  else {
60
58
  logger.trace("SqlCommand:", sqlCommand, "Parameters:", parameters);
@@ -80,12 +78,12 @@ class Database {
80
78
  executeSqlWithTransaction(sqlCommand, parameters) {
81
79
  let logger = this.logger;
82
80
  return new Promise((success, failed) => {
83
- if (!this.pool) return failed(apiResult.DB_CONNECTED_FAILED);
81
+ if (!this.pool) return success(apiResult.DB_CONNECTED_FAILED);
84
82
  ///创建出数据库连接,准备执行
85
83
  this.pool.getConnection(function (err, connection) {
86
84
  if (err) {
87
85
  logger.error("Database Connected Failed :"+ err);
88
- return failed(apiResult.DB_CONNECTED_FAILED);
86
+ return success(apiResult.DB_CONNECTED_FAILED);
89
87
  }
90
88
  logger.trace("SqlCommand:", sqlCommand, "Parameters:", parameters);
91
89
  ////开启事务保护
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doomiwork",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "doomisoft nodejs web framework",
5
5
  "main": "index.js",
6
6
  "scripts": {