feat: increase consumed task count upon tasks

This commit is contained in:
Ali BARIN
2023-03-07 21:26:12 +00:00
parent 7676bc5836
commit 472ffd5b5c
4 changed files with 30 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import type { ModelOptions, QueryContext } from 'objection';
import ExtendedQueryBuilder from './query-builder';
import Base from './base';
import Step from './step';
import User from './user';
import Execution from './execution';
import Telemetry from '../helpers/telemetry';
@@ -15,6 +16,7 @@ class Flow extends Base {
published_at: string;
remoteWebhookId: string;
executions?: Execution[];
user?: User;
static tableName = 'flows';
@@ -51,6 +53,14 @@ class Flow extends Base {
to: 'executions.flow_id',
},
},
user: {
relation: Base.HasOneRelation,
modelClass: User,
join: {
from: 'flows.user_id',
to: 'users.id',
},
},
});
async lastInternalId() {