@budibase/worker 2.29.15 → 2.29.17

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.29.15",
4
+ "version": "2.29.17",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "author": "Budibase",
38
38
  "license": "GPL-3.0",
39
39
  "dependencies": {
40
- "@budibase/backend-core": "2.29.15",
41
- "@budibase/pro": "2.29.15",
42
- "@budibase/string-templates": "2.29.15",
43
- "@budibase/types": "2.29.15",
40
+ "@budibase/backend-core": "2.29.17",
41
+ "@budibase/pro": "2.29.17",
42
+ "@budibase/string-templates": "2.29.17",
43
+ "@budibase/types": "2.29.17",
44
44
  "@koa/router": "8.0.8",
45
45
  "@techpass/passport-openidconnect": "0.3.3",
46
46
  "@types/global-agent": "2.1.1",
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "2bee50a1bc2e123a66a33c781826c020da1d6ea6"
110
+ "gitHead": "9937f16cdae5282ca44496f691acd4f0bcdefd90"
111
111
  }
@@ -1,6 +1,6 @@
1
1
  import { Ctx, MaintenanceType } from "@budibase/types"
2
2
  import env from "../../../environment"
3
- import { env as coreEnv } from "@budibase/backend-core"
3
+ import { env as coreEnv, db as dbCore } from "@budibase/backend-core"
4
4
  import nodeFetch from "node-fetch"
5
5
 
6
6
  let sqsAvailable: boolean
@@ -12,7 +12,12 @@ async function isSqsAvailable() {
12
12
  }
13
13
 
14
14
  try {
15
- await nodeFetch(coreEnv.COUCH_DB_SQL_URL, {
15
+ const couchInfo = dbCore.getCouchInfo()
16
+ if (!couchInfo.sqlUrl) {
17
+ sqsAvailable = false
18
+ return false
19
+ }
20
+ await nodeFetch(couchInfo.sqlUrl, {
16
21
  timeout: 1000,
17
22
  })
18
23
  sqsAvailable = true
@@ -24,7 +29,7 @@ async function isSqsAvailable() {
24
29
  }
25
30
 
26
31
  async function isSqsMissing() {
27
- return env.SQS_SEARCH_ENABLE && !(await isSqsAvailable())
32
+ return coreEnv.SQS_SEARCH_ENABLE && !(await isSqsAvailable())
28
33
  }
29
34
 
30
35
  export const fetch = async (ctx: Ctx) => {
package/src/api/index.ts CHANGED
@@ -5,8 +5,7 @@ const compress = require("koa-compress")
5
5
  import zlib from "zlib"
6
6
  import { routes } from "./routes"
7
7
  import { middleware as pro, sdk } from "@budibase/pro"
8
- import { auth, middleware } from "@budibase/backend-core"
9
- import env from "../environment"
8
+ import { auth, middleware, env } from "@budibase/backend-core"
10
9
 
11
10
  if (env.SQS_SEARCH_ENABLE) {
12
11
  sdk.auditLogs.useSQLSearch()
@@ -46,7 +46,6 @@ const environment = {
46
46
  DISABLE_ACCOUNT_PORTAL: process.env.DISABLE_ACCOUNT_PORTAL,
47
47
  SMTP_FALLBACK_ENABLED: process.env.SMTP_FALLBACK_ENABLED,
48
48
  DISABLE_DEVELOPER_LICENSE: process.env.DISABLE_DEVELOPER_LICENSE,
49
- SQS_SEARCH_ENABLE: process.env.SQS_SEARCH_ENABLE,
50
49
  BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
51
50
  // smtp
52
51
  SMTP_USER: process.env.SMTP_USER,