Skip to content

Commit

Permalink
chore: Use index on unlockAll query called when changing OM routing…
Browse files Browse the repository at this point in the history
… methods (#32860)
  • Loading branch information
KevLehman authored Aug 1, 2024
1 parent a663078 commit dd42703
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/meteor/server/models/raw/LivechatInquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ export class LivechatInquiryRaw extends BaseRaw<ILivechatInquiryRecord> implemen
},
},
{
locked: false,
},
{
locked: { $exists: false },
locked: { $ne: true },
},
],
},
Expand Down Expand Up @@ -189,7 +186,7 @@ export class LivechatInquiryRaw extends BaseRaw<ILivechatInquiryRecord> implemen

async unlockAll(): Promise<UpdateResult | Document> {
return this.updateMany(
{ $or: [{ lockedAt: { $exists: true } }, { locked: { $exists: true } }] },
{ locked: { $exists: true } },
{ $unset: { locked: 1, lockedAt: 1 }, $set: { status: LivechatInquiryStatus.QUEUED, queuedAt: new Date() } },
);
}
Expand Down

0 comments on commit dd42703

Please sign in to comment.