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

This commit is contained in:
mike12345567 2021-12-15 11:25:52 +00:00
parent a0bb13e5c0
commit d1127f3220
3 changed files with 11 additions and 5 deletions

View File

@ -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")

View File

@ -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")

View File

@ -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)
}