Skip to content

Commit

Permalink
mass confirm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Jul 13, 2024
1 parent 656b2b1 commit 40dfb9c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,19 @@ export class NeedController {

let toBeConfirmed = config().dataCache.fetchToBeConfirmed();

const expired = !toBeConfirmed || !toBeConfirmed.list[0];
!toBeConfirmed.createdAt ||
timeDifference(toBeConfirmed.createdAt, new Date()).mm >= 5;
const expired =
!toBeConfirmed ||
!toBeConfirmed.list[0] ||
!toBeConfirmed.createdAt ||
timeDifference(toBeConfirmed.createdAt, new Date()).mm >= 1;
console.log(`Mass prepare expired: ${expired}`);
console.log(
`Last prepare: ${
toBeConfirmed.createdAt &&
timeDifference(toBeConfirmed.createdAt, new Date()).mm
} ago`,
);

if (expired) {
const notConfirmed = await this.needService.getNotConfirmedNeeds(
null,
Expand Down

0 comments on commit 40dfb9c

Please sign in to comment.