diff --git a/README.MD b/README.MD index 1c9ff84..c3ac069 100644 --- a/README.MD +++ b/README.MD @@ -63,6 +63,10 @@ export class JobSchedulerService { ``` +#### Access `boss` Directly + +You can access the `PgBoss` instance directly via `pgBossService.boss` + #### Handle jobs using the `@Job` decorator ```ts diff --git a/lib/pgboss.service.ts b/lib/pgboss.service.ts index ea2ba75..a77c1d5 100644 --- a/lib/pgboss.service.ts +++ b/lib/pgboss.service.ts @@ -5,7 +5,10 @@ import { PGBOSS_TOKEN } from "./utils/consts"; @Injectable() export class PgBossService { - constructor(@Inject(PGBOSS_TOKEN) private readonly boss: PgBoss) {} + public boss: PgBoss; + constructor(@Inject(PGBOSS_TOKEN) boss: PgBoss) { + this.boss = boss; + } async scheduleJob( name: string,