@quintype/framework 7.0.2-test-worker.0 → 7.0.3-better-logs.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [7.0.2](https://github.com/quintype/quintype-node-framework/compare/v7.0.1...v7.0.2) (2022-01-05)
6
+
5
7
  ### [7.0.1](https://github.com/quintype/quintype-node-framework/compare/v6.3.0...v7.0.1) (2021-12-15)
6
8
 
7
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.0.2-test-worker.0",
3
+ "version": "7.0.3-better-logs.1",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "homepage": "https://github.com/quintype/quintype-node-framework#readme",
28
28
  "dependencies": {
29
29
  "@ampproject/toolbox-optimizer": "2.8.3",
30
- "@quintype/amp": "^2.4.17",
30
+ "@quintype/amp": "^2.4.18",
31
31
  "@quintype/backend": "^2.1.0",
32
32
  "@quintype/components": "^3.0.0",
33
33
  "@quintype/prerender-node": "^3.2.24",
package/server/start.js CHANGED
@@ -10,7 +10,7 @@
10
10
  // istanbul ignore file
11
11
  // This is the start file, to be called from your start.js
12
12
 
13
- const chalk = require("chalk");
13
+ const chalk = require('chalk');
14
14
  const cluster = require("cluster");
15
15
  const process = require("process");
16
16
  const { initializeAllClients } = require("./api-client");
@@ -48,7 +48,9 @@ function startMaster({ workers = 4 }) {
48
48
 
49
49
  cluster.on("exit", (worker, code, signal) => {
50
50
  logger.error(`worker ${worker.process.pid} died`);
51
- const aliveWorkers = Object.values(cluster.workers).filter((worker) => worker.state !== "dead");
51
+ const aliveWorkers = Object.values(cluster.workers).filter(
52
+ (worker) => worker.state !== "dead"
53
+ );
52
54
 
53
55
  if (terminating) {
54
56
  if (aliveWorkers.length == 0) {
@@ -73,7 +75,7 @@ async function startWorker(appThunk, opts) {
73
75
  await initializeAllClients();
74
76
  const server = app.listen(opts.port || 3000, () => {
75
77
  console.log(logSuccess(`||=============================||`));
76
- console.log(logSuccess(`|| App listening on port ${opts.port || 3000}! ||`));
78
+ console.log(logSuccess(`|| App listening on port ${opts.port || 3000}! ||`))
77
79
  console.log(logSuccess(`||=============================||`));
78
80
  });
79
81
 
@@ -85,13 +87,10 @@ async function startWorker(appThunk, opts) {
85
87
  });
86
88
  process.on("SIGHUP", () => {});
87
89
  } catch (e) {
88
- if (process.env.NODE_ENV !== "production") {
89
- console.log(e.stack);
90
- }
91
-
92
- e = e || "";
90
+ logger.error(`DEBUG: ========= ${JSON.stringify(e)} =============`);
91
+ logger.error(`DEBUG stack: ========= ${e.stack} =============`);
93
92
  const sleep = require("sleep-promise");
94
- logger.error(`Worker died - ${JSON.stringify(e.message.format) || JSON.stringify(e)}`);
93
+ logger.error(`DEBUG: Worker died - ${JSON.stringify(e)}`);
95
94
  cluster.worker.disconnect();
96
95
  await sleep(opts.sleep || 250);
97
96
  process.exit();