Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Upgrade typeorm (no-changelog) #5423

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"sse-channel": "^4.0.0",
"swagger-ui-express": "^4.3.0",
"syslog-client": "^1.1.1",
"typeorm": "0.3.11",
"typeorm": "^0.3.12",
"uuid": "^8.3.2",
"validator": "13.7.0",
"winston": "^3.3.3",
Expand Down
10 changes: 2 additions & 8 deletions packages/cli/src/license/License.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ import * as Db from '@/Db';

export class LicenseService {
static async getActiveTriggerCount(): Promise<number> {
const qb = Db.collections.Workflow.createQueryBuilder('workflow')
.select('SUM(workflow.triggerCount)', 'triggerCount')
.where('workflow.active = :active', { active: true });
const results: { triggerCount: number } | undefined = await qb.getRawOne();
if (!results) {
throw new Error('Could not get active trigger count');
}
return results.triggerCount ?? 0;
const totalTriggerCount = await Db.collections.Workflow.sum('triggerCount', { active: true });
return totalTriggerCount ?? 0;
}

// Helper for getting the basic license data that we want to return
Expand Down
Loading