@rpcbase/server 0.39.0 → 0.42.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.
- package/cli/run_docker.js +2 -2
- package/database.js +16 -1
- package/express/session_middleware.js +0 -2
- package/package.json +5 -5
package/cli/run_docker.js
CHANGED
|
@@ -16,8 +16,8 @@ const run_docker = async(infrastructure_dir, proj_prefix) => {
|
|
|
16
16
|
|
|
17
17
|
const opts = ["--build", "--remove-orphans"]
|
|
18
18
|
if (!is_production) opts.push("--abort-on-container-exit")
|
|
19
|
-
|
|
20
|
-
const cmd = `docker-compose --
|
|
19
|
+
|
|
20
|
+
const cmd = `docker-compose --env-file ${env_path} -p ${proj_prefix} ${compose_files.join(" ")} up ${opts.join(" ")}`
|
|
21
21
|
|
|
22
22
|
console.log(cmd)
|
|
23
23
|
try {
|
package/database.js
CHANGED
|
@@ -24,7 +24,22 @@ const mongo_url = `mongodb://${replicaset_str}/${DATABASE_NAME}?`
|
|
|
24
24
|
|
|
25
25
|
module.exports = async() => {
|
|
26
26
|
console.log("MONGO_URL", mongo_url)
|
|
27
|
-
const ret = await mongoose.connect(mongo_url
|
|
27
|
+
const ret = await mongoose.connect(mongo_url, {
|
|
28
|
+
keepAlive: true,
|
|
29
|
+
keepAliveInitialDelay: 10000,
|
|
30
|
+
minPoolSize: 3,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
// mongoose.connection.on("")
|
|
34
|
+
mongoose.connection.on("disconnected", (arg) => {
|
|
35
|
+
console.log("Mongoose disconnected", arg)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
mongoose.connection.on("error", (arg) => {
|
|
39
|
+
console.log("Mongoose connection error", arg)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// console.log("Mongoose connect got ret", ret)
|
|
28
43
|
// console.log("waiting after return", ret)
|
|
29
44
|
// TODO: handle connection retry and pools
|
|
30
45
|
}
|
|
@@ -14,8 +14,6 @@ if (typeof SESSION_STORE_PORT === "string" && !validator.isPort(SESSION_STORE_PO
|
|
|
14
14
|
throw new Error("expected SESSION_STORE_PORT to be a valid port number")
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// console.log("ICIII", execSync("redis-cli -p 7979 -h session-store ping", {stdio: "inherit"}))
|
|
18
|
-
|
|
19
17
|
const reconnectStrategy = (retries) => {
|
|
20
18
|
console.log("reconnectStrategy::retrying with arg", retries)
|
|
21
19
|
if (retries < 5) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"body-parser": "1.19.2",
|
|
14
|
-
"connect-redis": "6.1.
|
|
14
|
+
"connect-redis": "6.1.3",
|
|
15
15
|
"cors": "2.8.5",
|
|
16
|
-
"debug": "4.3.
|
|
16
|
+
"debug": "4.3.4",
|
|
17
17
|
"dotenv": "16.0.0",
|
|
18
18
|
"express": "4.17.3",
|
|
19
19
|
"express-session": "1.17.2",
|
|
20
20
|
"glob": "7.2.0",
|
|
21
|
-
"mongoose": "6.2.
|
|
21
|
+
"mongoose": "6.2.7",
|
|
22
22
|
"redis": "4.0.4",
|
|
23
23
|
"validator": "13.7.0",
|
|
24
|
-
"yargs": "17.
|
|
24
|
+
"yargs": "17.4.0"
|
|
25
25
|
}
|
|
26
26
|
}
|