Skip to content

Commit 68317d6

Browse files
committed
Use new schedules limits when checking a schedule
1 parent 28135d5 commit 68317d6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

apps/webapp/app/v3/services/checkSchedule.server.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ export class CheckScheduleService extends BaseService {
7070
},
7171
select: {
7272
organizationId: true,
73+
environments: {
74+
select: {
75+
id: true,
76+
type: true,
77+
},
78+
},
7379
},
7480
});
7581

@@ -78,10 +84,9 @@ export class CheckScheduleService extends BaseService {
7884
}
7985

8086
const limit = await getLimit(project.organizationId, "schedules", 100_000_000);
81-
const schedulesCount = await this._prisma.taskSchedule.count({
82-
where: {
83-
projectId,
84-
},
87+
const schedulesCount = await CheckScheduleService.getUsedSchedulesCount({
88+
prisma: this._prisma,
89+
environments: project.environments,
8590
});
8691

8792
if (schedulesCount >= limit) {

0 commit comments

Comments
 (0)