Ver código fonte

Merge branch 'Test' into 'master'

Test

See merge request crowd-2019/crowd-test-service-backend!150
郭超 5 anos atrás
pai
commit
160e8d0fa7

+ 2 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/CommonServiceImpl.java

@@ -26,6 +26,7 @@ import com.mooctest.crowd.site.service.CommonService;
 import com.mooctest.crowd.site.util.DataUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
@@ -185,6 +186,7 @@ public class CommonServiceImpl implements CommonService {
     }
 
     @Override
+    @Cacheable(value = "platformDataCache")
     public DataDTO getAllData() {
         DataDTO dataDTO = new DataDTO();
         List<CrowdTestProject> allCrowdTestProject = projectRepo.getAllCrowdTestProject();

+ 3 - 3
site/src/main/resources/application.yml

@@ -1,8 +1,8 @@
 spring:
   profiles:
 #    active: dev-pre
-    active: dev-online
-#     active: dev-localhost
+#    active: dev-online
+     active: dev-localhost
   cache:
     guava:
       spec: expireAfterWrite=30s
@@ -58,7 +58,7 @@ oss:
 
 cache:
   expire:
-    duration: 120
+    duration: 86400
 
 agency: 7