Skip to content

Commit 2b21f5b

Browse files
committed
bugfix: specifiying an alternate WORKER_SCHEMA now works
1 parent 8c27236 commit 2b21f5b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/webapp/app/platform/zodWorker.server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
108108
this.#recurringTasks = options.recurringTasks;
109109
}
110110

111+
get graphileWorkerSchema() {
112+
return this.#runnerOptions.schema ?? "graphile_worker";
113+
}
114+
111115
public async initialize(): Promise<boolean> {
112116
if (this.#runner) {
113117
return true;
@@ -252,7 +256,7 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
252256
tx: PrismaClientOrTransaction
253257
) {
254258
const results = await tx.$queryRawUnsafe(
255-
`SELECT * FROM graphile_worker.add_job(
259+
`SELECT * FROM ${this.graphileWorkerSchema}.add_job(
256260
identifier => $1::text,
257261
payload => $2::json,
258262
queue_name => $3::text,
@@ -290,7 +294,7 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
290294
async #removeJob(jobKey: string, tx: PrismaClientOrTransaction) {
291295
try {
292296
const result = await tx.$queryRawUnsafe(
293-
`SELECT * FROM graphile_worker.remove_job(
297+
`SELECT * FROM ${this.graphileWorkerSchema}.remove_job(
294298
job_key => $1::text
295299
)`,
296300
jobKey

0 commit comments

Comments
 (0)