scan for deleted tickets

This commit is contained in:
indifferentketchup
2026-04-07 10:15:58 -05:00
parent 7da082275f
commit 03794ceb25
3 changed files with 42 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ async function checkUnclaimedSurge(client) {
const count = await Ticket.countDocuments({
status: 'open',
claimedBy: null,
createdAt: { $lte: cutoff }
createdAt: { $lte: cutoff, $ne: null }
});
if (count >= CONFIG.SURGE_UNCLAIMED_COUNT) {
setCooldown('surge:unclaimed');
@@ -123,7 +123,7 @@ async function checkTier3UnclaimedSurge(client) {
status: 'open',
escalationTier: 2,
claimedBy: null,
createdAt: { $lte: cutoff }
createdAt: { $lte: cutoff, $ne: null }
}).lean();
if (tickets.length > 0) {
setCooldown('surge:tier3_unclaimed');