|
@@ -1,5 +1,6 @@
|
|
|
package com.izouma.nineth.service;
|
|
package com.izouma.nineth.service;
|
|
|
|
|
|
|
|
|
|
+import com.izouma.nineth.annotations.RedisLock;
|
|
|
import com.izouma.nineth.domain.PriceList;
|
|
import com.izouma.nineth.domain.PriceList;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.repo.CollectionRepo;
|
|
import com.izouma.nineth.repo.CollectionRepo;
|
|
@@ -25,6 +26,7 @@ public class PriceListService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 1, fixedRate = 5, timeUnit = TimeUnit.MINUTES)
|
|
@Scheduled(initialDelay = 1, fixedRate = 5, timeUnit = TimeUnit.MINUTES)
|
|
|
|
|
+ @RedisLock(value = "priceList", expire = 1, unit = TimeUnit.MINUTES)
|
|
|
public void schedule() {
|
|
public void schedule() {
|
|
|
cacheService.clearPriceList();
|
|
cacheService.clearPriceList();
|
|
|
for (PriceList priceList : priceListRepo.findAll()) {
|
|
for (PriceList priceList : priceListRepo.findAll()) {
|