@friggframework/core 2.0.0--canary.487.63ed8db.0 → 2.0.0--canary.490.eec7dcd.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.
|
@@ -29,32 +29,21 @@ class HealthCheckRepositoryMongoDB extends HealthCheckRepositoryInterface {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
|
-
readyState: isConnected ? 1 : 0,
|
|
33
32
|
readyState: isConnected ? 1 : 0,
|
|
34
33
|
stateName,
|
|
35
34
|
isConnected,
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @param {number} maxTimeMS
|
|
40
|
+
* @returns {Promise<number>} Response time in milliseconds
|
|
41
|
+
*/
|
|
39
42
|
async pingDatabase(maxTimeMS = 2000) {
|
|
40
43
|
const pingStart = Date.now();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
setTimeout(() => reject(new Error('Database ping timeout')), maxTimeMS)
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// Race between the database ping and the timeout
|
|
48
|
-
await Promise.race([
|
|
49
|
-
prisma.$queryRaw`SELECT 1`.catch(() => {
|
|
50
|
-
// For MongoDB, use runCommandRaw instead
|
|
51
|
-
return prisma.$runCommandRaw({ ping: 1 });
|
|
52
|
-
}),
|
|
53
|
-
timeoutPromise
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
return Date.now() - pingStart;
|
|
57
|
-
}
|
|
44
|
+
await this.prisma.$queryRaw`SELECT 1`.catch(() => {
|
|
45
|
+
return this.prisma.$runCommandRaw({ ping: 1 });
|
|
46
|
+
});
|
|
58
47
|
return Date.now() - pingStart;
|
|
59
48
|
}
|
|
60
49
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.490.eec7dcd.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
42
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
43
|
-
"@friggframework/test": "2.0.0--canary.
|
|
41
|
+
"@friggframework/eslint-config": "2.0.0--canary.490.eec7dcd.0",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0--canary.490.eec7dcd.0",
|
|
43
|
+
"@friggframework/test": "2.0.0--canary.490.eec7dcd.0",
|
|
44
44
|
"@prisma/client": "^6.17.0",
|
|
45
45
|
"@types/lodash": "4.17.15",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "eec7dcdaf12585353103eb99ebc141dfa60a6743"
|
|
84
84
|
}
|