|
@@ -0,0 +1,23 @@
|
|
|
+package com.tzld.piaoquan.recommend.server.service;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.annotation.Order;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author dyp
|
|
|
+ */
|
|
|
+@Component
|
|
|
+@Order(1)
|
|
|
+public class WarmUpService {
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate<String, String> redisTemplate;
|
|
|
+
|
|
|
+ @PostConstruct
|
|
|
+ public void warmup() {
|
|
|
+ redisTemplate.opsForValue().get("");
|
|
|
+ }
|
|
|
+}
|