1
0
Fork 0
mirror of synced 2024-06-27 02:20:35 +12:00

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 846f8b5038
commit ae5b963115
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)
}