1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Merge pull request #3793 from Budibase/fix/pouch-automation-error

Fix automation TypeError: Pouch is not a constructor
This commit is contained in:
Michael Drury 2021-12-15 15:30:56 +00:00 committed by GitHub
commit 57acbc016b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 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,13 @@
const env = require("../environment")
const CouchDB = require("../db")
const { init } = require("@budibase/auth")
exports.threadSetup = () => {
// don't run this if not threading
if (env.isTest() || env.DISABLE_THREADING) {
return
}
// when thread starts, make sure it is recorded
env.setInThread()
init(CouchDB)
}