From 22fb504de2e3e4937cb14e78c5baf19bbcc2220b Mon Sep 17 00:00:00 2001 From: gc <30398469+gc@users.noreply.github.com> Date: Wed, 25 Sep 2024 08:17:18 +1000 Subject: [PATCH] Fix test bot trips --- src/lib/Task.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/Task.ts b/src/lib/Task.ts index 2176848074..6515772122 100644 --- a/src/lib/Task.ts +++ b/src/lib/Task.ts @@ -93,7 +93,7 @@ import { guardiansOfTheRiftTask } from './../tasks/minions/minigames/guardiansOf import { nightmareZoneTask } from './../tasks/minions/minigames/nightmareZoneActivity'; import { underwaterAgilityThievingTask } from './../tasks/minions/underwaterActivity'; import { modifyBusyCounter } from './busyCounterCache'; -import { minionActivityCache } from './constants'; +import { globalConfig, minionActivityCache } from './constants'; import { sql } from './postgres'; import { convertStoredActivityToFlatActivity } from './settings/prisma'; import { activitySync, minionActivityCacheDelete } from './settings/settings'; @@ -193,8 +193,9 @@ const tasks: MinionTask[] = [ ]; export async function processPendingActivities() { - const activities: Activity[] = - await sql`SELECT * FROM activity WHERE completed = false AND finish_date < NOW() LIMIT 5;`; + const activities: Activity[] = globalConfig.isProduction + ? await sql`SELECT * FROM activity WHERE completed = false AND finish_date < NOW() LIMIT 5;` + : await sql`SELECT * FROM activity WHERE completed = false;`; if (activities.length > 0) { await prisma.activity.updateMany({