ensure automation quotas are not incremented for test runs

This commit is contained in:
Martin McKeaveney 2021-09-27 10:32:39 +01:00
parent 83384faed8
commit 6c7423e52e
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,7 @@ const AutomationEmitter = require("../events/AutomationEmitter")
const { processObject } = require("@budibase/string-templates")
const { DEFAULT_TENANT_ID } = require("@budibase/auth").constants
const CouchDB = require("../db")
const { DocumentTypes } = require("../db/utils")
const { DocumentTypes, isDevAppID } = require("../db/utils")
const { doInTenant } = require("@budibase/auth/tenancy")
const env = require("../environment")
const usage = require("../utilities/usageQuota")
@ -96,8 +96,9 @@ class Orchestrator {
return err
}
}
// TODO: don't count test runs
if (!env.SELF_HOSTED) {
// Increment quota for automation runs
if (!env.SELF_HOSTED && !isDevAppID(this._appId)) {
usage.update(usage.Properties.AUTOMATION, 1)
}
return this.executionOutput

View File

@ -157,7 +157,7 @@ exports.adminUser = async ctx => {
rows: 4000,
apps: 4,
storage: 1000,
users: 10
users: 10,
},
})
// }