Commit 73e9ece2f7e8674a89d106f8a12d8d51dc122980

Authored by xp.Huang
1 parent 94a22418

feat: 提供视频缓存清除方法

1 1 package org.thingsboard.server.common.data.yunteng.utils.tools;
  2 +import org.thingsboard.server.common.data.StringUtils;
  3 +
2 4 import java.time.LocalDateTime;
3 5 import java.util.HashMap;
4 6 import java.util.Iterator;
... ... @@ -28,6 +30,12 @@ public class VideoUrlUtils {
28 30 //如果过期了返回null
29 31 return nowTime.isAfter(expireTime) ? null : videoUrlInfo.get("url").toString();
30 32 }
  33 +
  34 + public static void clearVideoUrlData(String key){
  35 + if(null != videoUrlData && !videoUrlData.isEmpty() && !StringUtils.isEmpty(key)){
  36 + videoUrlData.remove(key);
  37 + }
  38 + }
31 39 private static void checkVideoUrlData(){
32 40 if(!videoUrlData.isEmpty()){
33 41 Iterator<Map.Entry<String, Map<String, Object>>> iterator = videoUrlData.entrySet().iterator();
... ...