@budibase/worker 3.1.1 → 3.1.2

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": "3.1.1",
4
+ "version": "3.1.2",
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": "3.1.1",
41
- "@budibase/pro": "3.1.1",
42
- "@budibase/string-templates": "3.1.1",
43
- "@budibase/types": "3.1.1",
40
+ "@budibase/backend-core": "3.1.2",
41
+ "@budibase/pro": "3.1.2",
42
+ "@budibase/string-templates": "3.1.2",
43
+ "@budibase/types": "3.1.2",
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": "a101d702d4b84cd8271f1fa8983126c26499042b"
110
+ "gitHead": "46651327a7efb09f554932785a898b120f0addb2"
111
111
  }
@@ -2,6 +2,7 @@ import { Ctx, MaintenanceType, FeatureFlag } from "@budibase/types"
2
2
  import env from "../../../environment"
3
3
  import { env as coreEnv, db as dbCore, features } from "@budibase/backend-core"
4
4
  import nodeFetch from "node-fetch"
5
+ import { helpers } from "@budibase/shared-core"
5
6
 
6
7
  let sqsAvailable: boolean
7
8
  async function isSqsAvailable() {
@@ -12,17 +13,22 @@ async function isSqsAvailable() {
12
13
  }
13
14
 
14
15
  try {
15
- const couchInfo = dbCore.getCouchInfo()
16
- if (!couchInfo.sqlUrl) {
16
+ const { url } = dbCore.getCouchInfo()
17
+ if (!url) {
17
18
  sqsAvailable = false
18
19
  return false
19
20
  }
20
- await nodeFetch(couchInfo.sqlUrl, {
21
- timeout: 1000,
22
- })
21
+ await helpers.retry(
22
+ async () => {
23
+ await nodeFetch(url, { timeout: 2000 })
24
+ },
25
+ { times: 3 }
26
+ )
27
+ console.log("connected to SQS")
23
28
  sqsAvailable = true
24
29
  return true
25
30
  } catch (e) {
31
+ console.warn("failed to connect to SQS", e)
26
32
  sqsAvailable = false
27
33
  return false
28
34
  }