feat: don't interrupt execution due to quota

This commit is contained in:
Ali BARIN
2023-03-09 15:13:50 +00:00
parent 8b81391e2f
commit ae3512fecf
4 changed files with 20 additions and 12 deletions

View File

@@ -131,7 +131,7 @@ class Flow extends Base {
});
}
async throwIfQuotaExceeded() {
async checkIfQuotaExceeded() {
if (!appConfig.isCloud) return;
const user = await this.$relatedQuery('user');
@@ -139,6 +139,18 @@ class Flow extends Base {
const hasExceeded = await usageData.checkIfLimitExceeded();
if (hasExceeded) {
return true;
}
return false;
}
async throwIfQuotaExceeded() {
if (!appConfig.isCloud) return;
const hasExceeded = await this.checkIfQuotaExceeded();
if (hasExceeded) {
throw new Error('The allowed task quota has been exhausted!');
}