Skip to content

Commit

Permalink
fix: unlock workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamesb committed Feb 28, 2024
1 parent aabbad6 commit d93b816
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/server/src/lib/jobsPrisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export async function getGraphileJobs(): Promise<any[]> {

export async function getRunningWorkerIds(): Promise<string[]> {
// unique list of locked_by ids
return await prisma.$queryRaw<string[]>(
Prisma.sql`SELECT DISTINCT locked_by FROM graphile_worker.jobs`
);
return (
await prisma.$queryRaw<{ locked_by: string }[]>(
Prisma.sql`SELECT DISTINCT locked_by FROM graphile_worker.jobs`
)
).map((x) => x.locked_by);
}

0 comments on commit d93b816

Please sign in to comment.