@things-factory/shell 8.0.0-alpha.22 → 8.0.0-alpha.28

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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "8.0.0-alpha.22",
3
+ "version": "8.0.0-alpha.28",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
7
7
  "things-factory-dev": "bin/things-factory-dev",
8
8
  "things-factory-migration": "bin/things-factory-migration",
9
9
  "things-factory-stop": "bin/things-factory-stop",
10
- "things-factory-dockerize": "bin/things-factory-dockerize"
10
+ "things-factory-dockerize": "bin/things-factory-dockerize",
11
+ "things-factory-dockerize-arm": "bin/things-factory-dockerize-arm"
11
12
  },
12
13
  "main": "dist-server/index.js",
13
14
  "browser": "client/index.js",
@@ -112,7 +113,6 @@
112
113
  "pwa-helpers": "^0.9.1",
113
114
  "react": "^18.2.0",
114
115
  "react-dom": "^18.2.0",
115
- "redux-thunk": "^2.3.0",
116
116
  "regenerator-runtime": "^0.13.2",
117
117
  "reselect": "^4.0.0",
118
118
  "sass": "^1.50.1",
@@ -126,12 +126,12 @@
126
126
  "ws": "^8.8.1"
127
127
  },
128
128
  "optionalDependencies": {
129
- "better-sqlite3": "^7.5.3",
130
- "mssql": "^10.0.2",
131
- "mysql2": "^2.3.3",
132
- "oracledb": "^5.4.0",
129
+ "better-sqlite3": "^11.5.0",
130
+ "mssql": "^11.0.1",
131
+ "mysql2": "^3.11.3",
132
+ "oracledb": "^6.6.0",
133
133
  "pg": "^8.7.3",
134
134
  "sqlite3": "^5.0.8"
135
135
  },
136
- "gitHead": "27cd29ef5f60c8fc8a177dd52eb0f4979b463991"
136
+ "gitHead": "a686f7c8320e5a67280cdb307f32f220c0297c77"
137
137
  }
@@ -244,11 +244,10 @@ const bootstrap = async () => {
244
244
  debug: false
245
245
  })
246
246
 
247
- const middleware =
248
- // only for development mode. triggered after webpack compilation is done.
249
- compiler.hooks.done.tap({ name: 'server-dev' }, stats => {
250
- process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)
251
- })
247
+ // only for development mode. triggered after webpack compilation is done.
248
+ compiler.hooks.done.tap({ name: 'server-dev' }, stats => {
249
+ process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)
250
+ })
252
251
 
253
252
  app.use(koaBodyParser(bodyParserOption))
254
253
 
package/server/server.ts CHANGED
@@ -264,6 +264,27 @@ const bootstrap = async () => {
264
264
  })
265
265
  )
266
266
 
267
+ // Set keep-alive timeout from configuration or fallback to default (65000ms).
268
+ // The keepAliveTimeout determines how long the server will keep an idle connection
269
+ // alive before closing it.
270
+ const keepAliveTimeout = config.get('keepAliveTimeout', 65000)
271
+
272
+ // Apply the configured keep-alive timeout to the server. If no configuration is
273
+ // provided, default to 65000ms (65 seconds). In the context of an external load balancer,
274
+ // this timeout is critical for maintaining persistent connections between the load
275
+ // balancer and the server. Setting a sufficiently long keepAliveTimeout minimizes
276
+ // the need to constantly re-establish TCP connections, improving efficiency and
277
+ // reducing connection overhead.
278
+ httpServer.keepAliveTimeout = keepAliveTimeout || 65000
279
+
280
+ // Set headersTimeout to be 1000ms (1 second) longer than keepAliveTimeout.
281
+ // This ensures the server has sufficient time to receive headers from the client
282
+ // before closing the connection, preventing premature disconnections. In the context
283
+ // of a load balancer, this ensures that if the load balancer is sending headers
284
+ // slowly (due to network delays or other factors), the connection isn't closed
285
+ // before the headers are fully transmitted.
286
+ httpServer.headersTimeout = keepAliveTimeout + 1000
287
+
267
288
  httpServer.listen({ port: PORT }, () => {
268
289
  logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)
269
290
  logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)