xiongzhu 3 år sedan
förälder
incheckning
d0d9bc810d
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      src/main/java/com/izouma/nineth/service/CollectionService.java

+ 3 - 3
src/main/java/com/izouma/nineth/service/CollectionService.java

@@ -64,13 +64,13 @@ public class CollectionService {
 
     @PostConstruct
     public void init() {
+        if (Arrays.asList(env.getActiveProfiles()).contains("dev")) {
+            return;
+        }
         List<Collection> collections = collectionRepo.findByScheduleSaleTrueAndOnShelfFalseAndStartTimeBeforeAndDelFalse(LocalDateTime.now());
         for (Collection collection : collections) {
             onShelfTask(collection);
         }
-        if (Arrays.asList(env.getActiveProfiles()).contains("dev")) {
-            return;
-        }
         for (CollectionStockAndSale collection : collectionRepo.getStockAndSale()) {
             if (redisTemplate.opsForValue().get("collectionStock::" + collection.getId()) == null) {
                 redisTemplate.opsForValue().set("collectionStock::" + collection.getId(), collection.getStock());