@budibase/server 2.6.3 → 2.6.5

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.
@@ -8,8 +8,8 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
10
10
  rel="stylesheet" />
11
- <script type="module" crossorigin src="/builder/assets/index.3ee9b71d.js"></script>
12
- <link rel="stylesheet" href="/builder/assets/index.4eae16b2.css">
11
+ <script type="module" crossorigin src="/builder/assets/index.666c917d.js"></script>
12
+ <link rel="stylesheet" href="/builder/assets/index.a8e7f825.css">
13
13
  </head>
14
14
 
15
15
  <body id="app">
@@ -27,7 +27,6 @@ function parseIntSafe(number) {
27
27
  return parseInt(number);
28
28
  }
29
29
  }
30
- let inThread = false;
31
30
  const environment = {
32
31
  // important - prefer app port to generic port
33
32
  PORT: process.env.APP_PORT || process.env.PORT,
@@ -86,12 +85,8 @@ const environment = {
86
85
  isProd: () => {
87
86
  return !isDev();
88
87
  },
89
- // used to check if already in a thread, don't thread further
90
- setInThread: () => {
91
- inThread = true;
92
- },
93
88
  isInThread: () => {
94
- return inThread;
89
+ return process.env.FORKED_PROCESS;
95
90
  },
96
91
  };
97
92
  // threading can cause memory issues with node-ts in development
@@ -66,6 +66,9 @@ class Thread {
66
66
  const workerOpts = {
67
67
  autoStart: true,
68
68
  maxConcurrentWorkers: this.count,
69
+ workerOptions: {
70
+ env: Object.assign(Object.assign({}, process.env), { FORKED_PROCESS: "1" }),
71
+ },
69
72
  };
70
73
  if (opts.timeoutMs) {
71
74
  this.timeoutMs = opts.timeoutMs;
@@ -59,11 +59,9 @@ function makeVariableKey(queryId, variable) {
59
59
  }
60
60
  function threadSetup() {
61
61
  // don't run this if not threading
62
- if (environment_1.default.isTest() || environment_1.default.DISABLE_THREADING) {
62
+ if (environment_1.default.isTest() || environment_1.default.DISABLE_THREADING || !environment_1.default.isInThread()) {
63
63
  return;
64
64
  }
65
- // when thread starts, make sure it is recorded
66
- environment_1.default.setInThread();
67
65
  db.init();
68
66
  }
69
67
  exports.threadSetup = threadSetup;