Skip to content

Commit 27f1db7

Browse files
committed
feat: find missing jobs fix
1 parent e09187d commit 27f1db7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export class PostsRepository {
4848
searchForMissingThreeHoursPosts() {
4949
return this._post.model.post.findMany({
5050
where: {
51+
integration: {
52+
refreshNeeded: false,
53+
inBetweenSteps: false,
54+
disabled: false,
55+
},
5156
publishDate: {
5257
gte: dayjs.utc().toDate(),
5358
lt: dayjs.utc().add(3, 'hour').toDate(),
@@ -66,6 +71,11 @@ export class PostsRepository {
6671
getOldPosts(orgId: string, date: string) {
6772
return this._post.model.post.findMany({
6873
where: {
74+
integration: {
75+
refreshNeeded: false,
76+
inBetweenSteps: false,
77+
disabled: false,
78+
},
6979
organizationId: orgId,
7080
publishDate: {
7181
lte: dayjs(date).toDate(),

libraries/nestjs-libraries/src/database/prisma/schema.prisma

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,14 @@ model Integration {
338338
@@unique([organizationId, internalId])
339339
@@index([rootInternalId])
340340
@@index([organizationId])
341+
@@index([providerIdentifier])
341342
@@index([updatedAt])
343+
@@index([createdAt])
342344
@@index([deletedAt])
343345
@@index([customerId])
346+
@@index([inBetweenSteps])
347+
@@index([refreshNeeded])
348+
@@index([disabled])
344349
}
345350

346351
model Signatures {

0 commit comments

Comments
 (0)