Browse Source
Merge pull request #7417 from Budibase/disable-automation-chaining-cloud
Disable automation chaining in cloud
master
Rory Powell
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
4 additions and
5 deletions
-
packages/server/src/api/controllers/row/index.ts
-
packages/server/src/automations/steps/updateRow.js
-
packages/server/src/events/AutomationEmitter.js
|
|
|
@ -35,9 +35,8 @@ export async function patch(ctx: any): Promise<any> { |
|
|
|
pickApi(tableId).patch(ctx) |
|
|
|
) |
|
|
|
ctx.status = 200 |
|
|
|
if (!ctx.disableEmit && ctx.eventEmitter) { |
|
|
|
ctx.eventEmitter && |
|
|
|
ctx.eventEmitter.emitRow(`row:update`, appId, row, table) |
|
|
|
} |
|
|
|
ctx.message = `${table.name} updated successfully.` |
|
|
|
ctx.body = row |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
@ -1,7 +1,6 @@ |
|
|
|
const rowController = require("../../api/controllers/row") |
|
|
|
const automationUtils = require("../automationUtils") |
|
|
|
const { buildCtx } = require("./utils") |
|
|
|
const env = require("../../environment") |
|
|
|
|
|
|
|
exports.definition = { |
|
|
|
name: "Update Row", |
|
|
|
@ -84,7 +83,6 @@ exports.run = async function ({ inputs, appId, emitter }) { |
|
|
|
rowId: inputs.rowId, |
|
|
|
tableId: tableId, |
|
|
|
}, |
|
|
|
disableEmit: !env.SELF_HOSTED, |
|
|
|
}) |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
@ -1,8 +1,10 @@ |
|
|
|
const { rowEmission, tableEmission } = require("./utils") |
|
|
|
const mainEmitter = require("./index") |
|
|
|
const env = require("../environment") |
|
|
|
|
|
|
|
// max number of automations that can chain on top of each other
|
|
|
|
const MAX_AUTOMATION_CHAIN = 5 |
|
|
|
// TODO: in future make this configurable at the automation level
|
|
|
|
const MAX_AUTOMATION_CHAIN = env.SELF_HOSTED ? 5 : 0 |
|
|
|
|
|
|
|
/** |
|
|
|
* Special emitter which takes the count of automation runs which have occurred and blocks an |
|
|
|
|