From 9495b895dd84f26d8c91ffd35af58e0c950033e3 Mon Sep 17 00:00:00 2001 From: dwusiq Date: Tue, 23 Apr 2024 17:34:03 +0800 Subject: [PATCH] fix bounty bug of update status --- src/main/java/com/dl/officialsite/bounty/BountyService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dl/officialsite/bounty/BountyService.java b/src/main/java/com/dl/officialsite/bounty/BountyService.java index d585144e..c9566b28 100644 --- a/src/main/java/com/dl/officialsite/bounty/BountyService.java +++ b/src/main/java/com/dl/officialsite/bounty/BountyService.java @@ -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 bountyList = bountyRepository.findAll( (root, criteriaQuery, criteriaBuilder) -> { List 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();