Skip to content

Commit ceb4e7d

Browse files
committed
fix: update job creation logic in Agenda.now method
1 parent 9af8d07 commit ceb4e7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ export class Agenda extends EventEmitter {
541541
async now<DATA>(name: string, data?: DATA): Promise<Job<DATA | void>> {
542542
log('Agenda.now(%s, [Object])', name);
543543
try {
544-
const job = this.create(name, data);
544+
const job = await this.jobs({ name })[0];
545545

546546
job.schedule(new Date());
547547
await job.save();

0 commit comments

Comments
 (0)