Skip to content

Commit b7ac3d1

Browse files
committed
fix: improve job retrieval logic in Agenda.now method for clarity
1 parent 80d03e7 commit b7ac3d1

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-
let job = await this.jobs({ name })[0];
544+
let job = (await this.jobs({ name }))[0];
545545
if (!job) job = this.create(name, data);
546546

547547
job.schedule(new Date());

0 commit comments

Comments
 (0)