Skip to content

Commit

Permalink
Merge pull request #715 from Shelf-nu/fix-initialization-of-pgboss
Browse files Browse the repository at this point in the history
Fix initialization of pgboss
  • Loading branch information
DonKoko authored Feb 5, 2024
2 parents 730c9c3 + 4ce38bf commit 5135d43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ schedulerService
// eslint-disable-next-line no-console
console.log("Scheduler and workers registered");
})
// eslint-disable-next-line no-console
.catch((e) => console.error(e));
// === end: register scheduler and workers ===

Expand Down
3 changes: 3 additions & 0 deletions app/modules/booking/worker.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import type { SchedulerData } from "./types";

/** ===== start: listens and creates chain of jobs for a given booking ===== */

let counter = 0;
export const registerBookingWorkers = () => {
console.log(`called registerBookingWorkers ${++counter} `);

/** Check-out reminder */
scheduler.work<SchedulerData>(
schedulerKeys.checkoutReminder,
Expand Down
1 change: 0 additions & 1 deletion app/utils/scheduler.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DIRECT_URL, NODE_ENV } from "../utils/env";
let scheduler!: PgBoss;

declare global {
// eslint-disable-next-line no-var
var scheduler: PgBoss;
}

Expand Down

0 comments on commit 5135d43

Please sign in to comment.