feat: find missing jobs fix

This commit is contained in:
Nevo David 2025-08-09 12:05:09 +07:00
parent e09187db50
commit 27f1db769a
2 changed files with 15 additions and 0 deletions

View File

@ -48,6 +48,11 @@ export class PostsRepository {
searchForMissingThreeHoursPosts() {
return this._post.model.post.findMany({
where: {
integration: {
refreshNeeded: false,
inBetweenSteps: false,
disabled: false,
},
publishDate: {
gte: dayjs.utc().toDate(),
lt: dayjs.utc().add(3, 'hour').toDate(),
@ -66,6 +71,11 @@ export class PostsRepository {
getOldPosts(orgId: string, date: string) {
return this._post.model.post.findMany({
where: {
integration: {
refreshNeeded: false,
inBetweenSteps: false,
disabled: false,
},
organizationId: orgId,
publishDate: {
lte: dayjs(date).toDate(),

View File

@ -338,9 +338,14 @@ model Integration {
@@unique([organizationId, internalId])
@@index([rootInternalId])
@@index([organizationId])
@@index([providerIdentifier])
@@index([updatedAt])
@@index([createdAt])
@@index([deletedAt])
@@index([customerId])
@@index([inBetweenSteps])
@@index([refreshNeeded])
@@index([disabled])
}
model Signatures {