first commit

This commit is contained in:
cys841515238
2023-03-02 16:13:28 +08:00
commit 2733a60b97
741 changed files with 76931 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package com.peanut.modules.book.task;
import com.peanut.modules.book.service.ShopSeckillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@Slf4j
@Service
public class SeckillProdScheduled {
@Autowired
ShopSeckillService shopSeckillService;
@Scheduled(cron = "0 0/1 * * * ?")
public void uploadSeckilProd3Days() {
Lock l = new ReentrantLock();
l.lock();
try {
shopSeckillService.uploadSeckilProd3Days();
}catch (Exception e){
e.printStackTrace();
}finally {
l.unlock();
}
}
}