Skip to content

Commit b7a66a2

Browse files
committed
More optimised query
1 parent b3a9ef3 commit b7a66a2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/webapp/app/presenters/v3/LimitsPresenter.server.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,11 @@ export class LimitsPresenter extends BasePresenter {
129129
? "override"
130130
: "default";
131131

132-
// Get schedule count for this org
132+
// Get schedule count for this org (via project relation which has an index)
133133
const scheduleCount = await this._replica.taskSchedule.count({
134134
where: {
135-
instances: {
136-
some: {
137-
environment: {
138-
organizationId,
139-
},
140-
},
135+
project: {
136+
organizationId,
141137
},
142138
},
143139
});

0 commit comments

Comments
 (0)