Commit f15e607c authored by shiyu's avatar shiyu

分享

parent b0a74ad7
...@@ -18,6 +18,7 @@ import org.redisson.api.RedissonClient; ...@@ -18,6 +18,7 @@ import org.redisson.api.RedissonClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -57,7 +58,7 @@ public class NewItemNoticeJob { ...@@ -57,7 +58,7 @@ public class NewItemNoticeJob {
/** /**
* 每天晚上八点执行一次 * 每天晚上八点执行一次
*/ */
// @Scheduled(cron = "0 0 20 * * ?") //@Scheduled(cron = "0 0 20 * * ?")
public void execute() { public void execute() {
RLock lock = redissonClient.getLock(NEW_ITEM_NOTICE_KEY); RLock lock = redissonClient.getLock(NEW_ITEM_NOTICE_KEY);
if (!lock.tryLock()) { if (!lock.tryLock()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment