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 93ccea7f06
commit 9cb20bcda2
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 { processObject } = require("@budibase/string-templates")
const { DEFAULT_TENANT_ID } = require("@budibase/auth").constants const { DEFAULT_TENANT_ID } = require("@budibase/auth").constants
const CouchDB = require("../db") const CouchDB = require("../db")
const { DocumentTypes } = require("../db/utils") const { DocumentTypes, isDevAppID } = require("../db/utils")
const { doInTenant } = require("@budibase/auth/tenancy") const { doInTenant } = require("@budibase/auth/tenancy")
const env = require("../environment") const env = require("../environment")
const usage = require("../utilities/usageQuota") const usage = require("../utilities/usageQuota")
@ -96,8 +96,9 @@ class Orchestrator {
return err 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) usage.update(usage.Properties.AUTOMATION, 1)
} }
return this.executionOutput return this.executionOutput

View File

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