From cfcda861640644e3597eff70775bfaf7186a55ad Mon Sep 17 00:00:00 2001
From: Iwan Lebron <105045937+iwanlebron@users.noreply.github.com>
Date: 星期四, 01 八月 2024 10:15:37 +0800
Subject: [PATCH] Merge branch '648540858:master' into master
---
src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java b/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java
index 72f0db6..229aeab 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java
@@ -1,7 +1,9 @@
package com.genersoft.iot.vmp.conf;
+import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -11,14 +13,17 @@
@Autowired
private IRedisCatchStorage redisCatchStorage;
+ @Value("${server.port}")
+ private int serverPort;
+
@Autowired
private SipConfig sipConfig;
- @Autowired
- private MediaConfig mediaConfig;
-
-// @Scheduled(cron="0/2 * * * * ? ") //姣�3绉掓墽琛屼竴娆�
-// public void execute(){
-//// redisCatchStorage.updateWVPInfo();
-// }
+ @Scheduled(fixedRate = 2 * 1000) //姣�3绉掓墽琛屼竴娆�
+ public void execute(){
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("ip", sipConfig.getShowIp());
+ jsonObject.put("port", serverPort);
+ redisCatchStorage.updateWVPInfo(jsonObject, 3);
+ }
}
--
Gitblit v1.8.0