From fb1829dd2e8a28a010144c7f65a9de04eac30a2a Mon Sep 17 00:00:00 2001 From: dnviyth Date: Mon, 25 Dec 2023 09:15:41 +0800 Subject: [PATCH] fix: add `lastModifiedBy` update when lock job --- src/JobDbRepository.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JobDbRepository.ts b/src/JobDbRepository.ts index 3f216c7..07717f2 100644 --- a/src/JobDbRepository.ts +++ b/src/JobDbRepository.ts @@ -105,7 +105,7 @@ export class JobDbRepository { }; // Update / options for the MongoDB query - const update: UpdateFilter = { $set: { lockedAt: new Date() } }; + const update: UpdateFilter = { $set: { lockedAt: new Date(), lastModifiedBy: this.agenda.attrs.name } }; const options: FindOneAndUpdateOptions = { returnDocument: 'after', sort: this.connectOptions.sort @@ -148,7 +148,7 @@ export class JobDbRepository { /** * Query used to set a job as locked */ - const JOB_PROCESS_SET_QUERY: UpdateFilter = { $set: { lockedAt: now } }; + const JOB_PROCESS_SET_QUERY: UpdateFilter = { $set: { lockedAt: now, lastModifiedBy: this.agenda.attrs.name } }; /** * Query used to affect what gets returned