Fixing .gitignore
This commit is contained in:
@@ -1,33 +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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user