Skip to content

Commit

Permalink
Fixes jobs types
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Oct 28, 2024
1 parent a615967 commit a3957b4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ export function createJobDefinition<
entities,
}: {
// jobName - The user-defined job name in their .wasp file.
jobName: Parameters<PgBoss['schedule']>[0]
jobName: PgBossJob<Input, Output, Entities>['jobName']
// defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation,
// which can overriden in that call.
defaultJobOptions: PgBoss.Schedule['options']
jobSchedule: JobSchedule | null
defaultJobOptions: PgBossJob<Input, Output, Entities>['defaultJobOptions']
jobSchedule: PgBossJob<Input, Output, Entities>['jobSchedule']
// Entities used by job, passed into callback context.
entities: Entities
}) {
return new PgBossJob<Input, Output, Entities>(
jobName,
// @ts-ignore
defaultJobOptions,
entities,
jobSchedule,
Expand Down Expand Up @@ -108,7 +107,7 @@ class PgBossJob<
Output extends JSONValue | void,
Entities extends Partial<PrismaDelegate>
> extends Job {
public readonly defaultJobOptions?: Parameters<PgBoss['send']>[2]
public readonly defaultJobOptions: Parameters<PgBoss['send']>[2]
public readonly startAfter: number | string | Date | undefined
public readonly entities: Entities
public readonly jobSchedule: JobSchedule | null
Expand All @@ -129,7 +128,6 @@ class PgBossJob<
delay(startAfter: number | string | Date) {
return new PgBossJob<Input, Output, Entities>(
this.jobName,
// @ts-ignore
this.defaultJobOptions,
this.entities,
this.jobSchedule,
Expand Down

0 comments on commit a3957b4

Please sign in to comment.