@budibase/worker 1.3.6 → 1.3.9

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": "1.3.6",
4
+ "version": "1.3.9",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -35,10 +35,10 @@
35
35
  "author": "Budibase",
36
36
  "license": "GPL-3.0",
37
37
  "dependencies": {
38
- "@budibase/backend-core": "^1.3.6",
39
- "@budibase/pro": "1.3.5",
40
- "@budibase/string-templates": "^1.3.6",
41
- "@budibase/types": "^1.3.6",
38
+ "@budibase/backend-core": "^1.3.9",
39
+ "@budibase/pro": "1.3.8",
40
+ "@budibase/string-templates": "^1.3.9",
41
+ "@budibase/types": "^1.3.9",
42
42
  "@koa/router": "8.0.8",
43
43
  "@sentry/node": "6.17.7",
44
44
  "@techpass/passport-openidconnect": "0.3.2",
@@ -103,5 +103,5 @@
103
103
  "./scripts/jestSetup.js"
104
104
  ]
105
105
  },
106
- "gitHead": "6f9f6b54acf28819286ce19e48823b1cd96cea92"
106
+ "gitHead": "2d19d885fce434249a88840db60386befbf91914"
107
107
  }
@@ -1,6 +1,7 @@
1
1
  const { StaticDatabases, doWithDB } = require("@budibase/backend-core/db")
2
2
  const { getTenantId } = require("@budibase/backend-core/tenancy")
3
3
  const { deleteTenant } = require("@budibase/backend-core/deprovision")
4
+ const { quotas } = require("@budibase/pro")
4
5
 
5
6
  exports.exists = async ctx => {
6
7
  const tenantId = ctx.request.params
@@ -48,6 +49,7 @@ exports.delete = async ctx => {
48
49
 
49
50
  try {
50
51
  await deleteTenant(tenantId)
52
+ await quotas.bustCache()
51
53
  ctx.status = 204
52
54
  } catch (err) {
53
55
  ctx.log.error(err)
@@ -47,10 +47,7 @@ describe("accounts", () => {
47
47
 
48
48
  const response = await api.accounts.destroyMetadata(id)
49
49
 
50
- expect(response.status).toBe(404)
51
- expect(response.body.message).toBe(
52
- `id=${accounts.formatAccountMetadataId(id)} does not exist`
53
- )
50
+ expect(response.status).toBe(204)
54
51
  })
55
52
  })
56
53
  })
@@ -46,8 +46,14 @@ export const destroyMetadata = async (accountId: string) => {
46
46
  await db.doWithDB(StaticDatabases.PLATFORM_INFO.name, async (db: any) => {
47
47
  const metadata = await getMetadata(accountId)
48
48
  if (!metadata) {
49
- throw new HTTPError(`id=${accountId} does not exist`, 404)
49
+ return
50
+ }
51
+ try {
52
+ await db.remove(accountId, metadata._rev)
53
+ } catch (e: any) {
54
+ if (e.status !== 404) {
55
+ throw e
56
+ }
50
57
  }
51
- await db.remove(accountId, metadata._rev)
52
58
  })
53
59
  }