@syncbridge/sqb 0.4.23 → 0.4.24
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.
- package/components/sqb-client.component.js +1 -28
- package/constants.js +1 -1
- package/package.json +2 -2
|
@@ -55,34 +55,7 @@ let SqbClientComponent = class SqbClientComponent extends ComponentBase {
|
|
|
55
55
|
}
|
|
56
56
|
async _start(abortSignal) {
|
|
57
57
|
await super._start(abortSignal);
|
|
58
|
-
|
|
59
|
-
if (!(this.status === ServiceStatus.starting ||
|
|
60
|
-
this.status === ServiceStatus.unhealthy))
|
|
61
|
-
return;
|
|
62
|
-
this._testConnection();
|
|
63
|
-
let aborted = false;
|
|
64
|
-
let waitTimer;
|
|
65
|
-
abortSignal.addEventListener('abort', () => {
|
|
66
|
-
if (aborted)
|
|
67
|
-
return;
|
|
68
|
-
aborted = true;
|
|
69
|
-
clearTimeout(waitTimer);
|
|
70
|
-
this.client.close(0);
|
|
71
|
-
});
|
|
72
|
-
return this.client
|
|
73
|
-
.test()
|
|
74
|
-
.then(() => {
|
|
75
|
-
this.logger?.trace(`Database connection success`);
|
|
76
|
-
this.setStatus(ServiceStatus.started);
|
|
77
|
-
})
|
|
78
|
-
.catch(err => {
|
|
79
|
-
waitTimer = setTimeout(testConnection, 5000).unref();
|
|
80
|
-
const msg = `Database connection failed. ${err.message}`;
|
|
81
|
-
this.logger?.error(msg);
|
|
82
|
-
this.setStatus(ServiceStatus.unhealthy, msg);
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
await testConnection();
|
|
58
|
+
await this._testConnection(abortSignal);
|
|
86
59
|
}
|
|
87
60
|
async _stop() {
|
|
88
61
|
clearTimeout(this._livenessTimer);
|
package/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncbridge/sqb",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.24",
|
|
4
4
|
"description": "SyncBridge SQB database connection components",
|
|
5
5
|
"author": "Panates Inc",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@syncbridge/common": "^0.6.3",
|
|
17
|
-
"@syncbridge/builtins": "^0.4.
|
|
17
|
+
"@syncbridge/builtins": "^0.4.24",
|
|
18
18
|
"@sqb/builder": ">=4.19.6 <5",
|
|
19
19
|
"@sqb/connect": ">=4.19.6 <5"
|
|
20
20
|
},
|