Browse Source

Fixing an issue with automations throwing a Pouch error due to the auth library database not being setup.

pull/3793/head
mike12345567 5 years ago
parent
commit
ae5b963115
  1. 3
      packages/server/src/threads/automation.js
  2. 4
      packages/server/src/threads/query.js
  3. 9
      packages/server/src/threads/utils.js

3
packages/server/src/threads/automation.js

@ -1,6 +1,5 @@
// when thread starts, make sure it is recorded
require("./utils").threadSetup()
const env = require("../environment")
env.setInThread()
const actions = require("../automations/actions")
const automationUtils = require("../automations/automationUtils")
const AutomationEmitter = require("../events/AutomationEmitter")

4
packages/server/src/threads/query.js

@ -1,6 +1,4 @@
// when thread starts, make sure it is recorded
const env = require("../environment")
env.setInThread()
require("./utils").threadSetup()
const ScriptRunner = require("../utilities/scriptRunner")
const { integrations } = require("../integrations")

9
packages/server/src/threads/utils.js

@ -0,0 +1,9 @@
const env = require("../environment")
const CouchDB = require("../db")
const { init } = require("@budibase/auth")
exports.threadSetup = () => {
// when thread starts, make sure it is recorded
env.setInThread()
init(CouchDB)
}
Loading…
Cancel
Save