@rpcbase/server 0.52.0 → 0.53.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_native.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* @flow */
2
2
  const {spawn} = require("child_process")
3
- const dotenv = require("dotenv")
3
+ // const dotenv = require("dotenv")
4
4
  const path = require("path")
5
5
  const fs = require("fs")
6
6
 
@@ -20,20 +20,18 @@ const run_processes = [
20
20
  ]],
21
21
  ]
22
22
 
23
-
24
-
25
- const get_env = () => {
26
- const env_path = path.join(process.cwd(), ".env")
27
- const env_buf = fs.readFileSync(env_path)
28
- const env = dotenv.parse(env_buf)
29
- return env
30
- }
23
+ // const get_env = () => {
24
+ // const env_path = path.join(process.cwd(), ".env")
25
+ // const env_buf = fs.readFileSync(env_path)
26
+ // const env = dotenv.parse(env_buf)
27
+ // return env
28
+ // }
31
29
 
32
30
 
33
31
 
34
32
  const run_native = (infrastructure_dir, proj_prefix) => {
35
33
  console.log("native mode")
36
- const env = get_env()
34
+ // const env = get_env()
37
35
 
38
36
  const ps = spawn("ls", ["-la"])
39
37
  ps.stdout.on("data", (data) => {
@@ -17,8 +17,8 @@ if (typeof SESSION_STORE_PORT === "string" && !validator.isPort(SESSION_STORE_PO
17
17
  let session_middleware = null
18
18
 
19
19
  // extreme warning: when there is blocking io redis client won't connect
20
- process.nextTick(async() => {
21
-
20
+ // process.nextTick(async() => {
21
+ setTimeout(async() => {
22
22
  if (!SESSION_STORE_PORT) {
23
23
  return
24
24
  }
@@ -35,7 +35,7 @@ process.nextTick(async() => {
35
35
 
36
36
  const redis_client = createClient({
37
37
  socket: {
38
- host: "127.0.0.1",
38
+ host: "session-store",
39
39
  port: SESSION_STORE_PORT,
40
40
  reconnectStrategy,
41
41
  connectTimeout: 10000,
@@ -44,9 +44,12 @@ process.nextTick(async() => {
44
44
  legacyMode: true,
45
45
  })
46
46
 
47
- console.log("redis session willconnect")
48
- await redis_client.connect()
49
- console.log("redis session connected")
47
+
48
+ redis_client.on("ready", () => {
49
+ console.log("session-storage::redis_client connected")
50
+ })
51
+
52
+ const res = await redis_client.connect()
50
53
 
51
54
  session_middleware = session({
52
55
  store: new redis_store({client: redis_client}),
@@ -57,7 +60,7 @@ process.nextTick(async() => {
57
60
  resave: false,
58
61
  })
59
62
 
60
- })
63
+ }, 500)
61
64
 
62
65
 
63
66
  module.exports = (req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -14,14 +14,13 @@
14
14
  "connect-redis": "6.1.3",
15
15
  "cors": "2.8.5",
16
16
  "debug": "4.3.4",
17
- "dotenv": "16.0.0",
18
17
  "express": "4.18.1",
19
- "express-session": "1.17.2",
20
- "glob": "8.0.1",
21
- "mongoose": "6.3.2",
18
+ "express-session": "1.17.3",
19
+ "glob": "8.0.3",
20
+ "mongoose": "6.3.3",
22
21
  "postmark": "3.0.1",
23
22
  "redis": "4.1.0",
24
23
  "validator": "13.7.0",
25
- "yargs": "17.4.1"
24
+ "yargs": "17.5.1"
26
25
  }
27
26
  }