Skip to content

Commit

Permalink
Merge pull request #239 from dwusiq/dev
Browse files Browse the repository at this point in the history
fix bounty bug of update status
  • Loading branch information
yanyanho authored Apr 23, 2024
2 parents 69ed3f4 + 9495b89 commit c67270d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/dl/officialsite/bounty/BountyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public BountyService(BountyRepository bountyRepository,
@Scheduled(cron = "${jobs.bounty.corn:0 0 * * * *}")
@ConditionalOnProperty(name = "scheduler.enabled", havingValue = "true", matchIfMissing = true)
public void updateBountyData() {
log.info("schedule task begin --------------------- ");
log.info("updateBountyData_schedule task begin --------------------- ");
//update status
long currentSeconds = System.currentTimeMillis() / 1000;
List<Bounty> bountyList = bountyRepository.findAll(
(root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicates = new ArrayList<>();
predicates.add(criteriaBuilder.equal(root.get("status"), BountyStatusEnum.IN_RECRUITMENT.getData()));
predicates.add(criteriaBuilder.lessThan(root.get("streamEnd"), currentSeconds));
return criteriaQuery.where(predicates.toArray(new Predicate[predicates.size()]))
.getRestriction();
Expand Down

0 comments on commit c67270d

Please sign in to comment.