|
@@ -0,0 +1,34 @@
|
|
|
+package com.fdkk.fdkkmeta.task;
|
|
|
+
|
|
|
+import com.fdkk.fdkkmeta.domain.entity.mysql.UserEntity;
|
|
|
+import com.fdkk.fdkkmeta.redis.RedisCache;
|
|
|
+import com.fdkk.fdkkmeta.service.UserService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author Xiewj
|
|
|
+ * @date 2022/3/30
|
|
|
+ */
|
|
|
+@Component
|
|
|
+@Slf4j
|
|
|
+public class UpdateFrameMeta {
|
|
|
+ @Autowired
|
|
|
+ RedisCache redisCache;
|
|
|
+ @Autowired
|
|
|
+ UserService userService;
|
|
|
+
|
|
|
+ @Scheduled(initialDelay=1000, fixedDelay=1000/30)
|
|
|
+ public void updateFrameMetadata(){
|
|
|
+ List<UserEntity> userOnline = userService.findUserOnline(true);
|
|
|
+ for (UserEntity userEntity : userOnline) {
|
|
|
+ redisCache.setCacheObject("updateFrameMetadata:"+userEntity.getUserId(),null);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|