@budibase/worker 2.4.27-alpha.6 → 2.4.27-alpha.8

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.4.27-alpha.6",
4
+ "version": "2.4.27-alpha.8",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -36,10 +36,10 @@
36
36
  "author": "Budibase",
37
37
  "license": "GPL-3.0",
38
38
  "dependencies": {
39
- "@budibase/backend-core": "2.4.27-alpha.6",
40
- "@budibase/pro": "2.4.27-alpha.5",
41
- "@budibase/string-templates": "2.4.27-alpha.6",
42
- "@budibase/types": "2.4.27-alpha.6",
39
+ "@budibase/backend-core": "2.4.27-alpha.8",
40
+ "@budibase/pro": "2.4.27-alpha.7",
41
+ "@budibase/string-templates": "2.4.27-alpha.8",
42
+ "@budibase/types": "2.4.27-alpha.8",
43
43
  "@koa/router": "8.0.8",
44
44
  "@sentry/node": "6.17.7",
45
45
  "@techpass/passport-openidconnect": "0.3.2",
@@ -101,5 +101,5 @@
101
101
  "typescript": "4.7.3",
102
102
  "update-dotenv": "1.1.1"
103
103
  },
104
- "gitHead": "a07047d7ecf7139646414705b6c5127bc8c0b190"
104
+ "gitHead": "daeec6f5201291037b1ba89e7db3b587a09bd2e1"
105
105
  }
package/scripts/test.sh CHANGED
@@ -3,10 +3,10 @@
3
3
  if [[ -n $CI ]]
4
4
  then
5
5
  # --runInBand performs better in ci where resources are limited
6
- echo "jest --coverage --runInBand"
7
- jest --coverage --runInBand
6
+ echo "jest --coverage --runInBand --forceExit"
7
+ jest --coverage --runInBand --forceExit
8
8
  else
9
9
  # --maxWorkers performs better in development
10
10
  echo "jest --coverage --maxWorkers=2"
11
11
  jest --coverage --maxWorkers=2
12
- fi
12
+ fi
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  middleware,
22
22
  queue,
23
23
  env as coreEnv,
24
+ timers,
24
25
  } from "@budibase/backend-core"
25
26
  db.init()
26
27
  import Koa from "koa"
@@ -91,6 +92,7 @@ server.on("close", async () => {
91
92
  }
92
93
  shuttingDown = true
93
94
  console.log("Server Closed")
95
+ timers.cleanup()
94
96
  await redis.shutdown()
95
97
  await events.shutdown()
96
98
  await queue.shutdown()
@@ -106,6 +106,8 @@ class TestConfiguration {
106
106
  async afterAll() {
107
107
  if (this.server) {
108
108
  await this.server.close()
109
+ } else {
110
+ await require("../index").default.close()
109
111
  }
110
112
  }
111
113
 
@@ -10,3 +10,4 @@ process.env.MINIO_SECRET_KEY = "test"
10
10
  process.env.PLATFORM_URL = "http://localhost:10000"
11
11
  process.env.INTERNAL_API_KEY = "tet"
12
12
  process.env.DISABLE_ACCOUNT_PORTAL = "0"
13
+ process.env.REDIS_PASSWORD = "budibase"
@@ -2,7 +2,7 @@ import "./logging"
2
2
 
3
3
  import { mocks, testContainerUtils } from "@budibase/backend-core/tests"
4
4
  import env from "../environment"
5
- import { env as coreEnv } from "@budibase/backend-core"
5
+ import { env as coreEnv, timers } from "@budibase/backend-core"
6
6
 
7
7
  // must explicitly enable fetch mock
8
8
  mocks.fetch.enable()
@@ -21,3 +21,7 @@ if (!process.env.CI) {
21
21
  }
22
22
 
23
23
  testContainerUtils.setupEnv(env, coreEnv)
24
+
25
+ afterAll(() => {
26
+ timers.cleanup()
27
+ })