Преглед изворни кода

修改:定时销毁房间逻辑

hgw пре 3 година
родитељ
комит
d7288de021

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -282,7 +282,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
                 //现在时间 大于 (退出房间的时间 + expiredMinute 分钟),则销毁
                 if (Objects.nonNull(speakerInfo.getExitRoomTime())) {
                     Date comparedTime = DateUtil.addMinutes(speakerInfo.getExitRoomTime(), expiredMinute);
-                    if (now.getTime() >= comparedTime.getTime()) {
+                    if (now.getTime() >= comparedTime.getTime() && speakerInfo.getState() != 0) {
                         roomDestroy(room);
                     }
                 }
@@ -714,6 +714,10 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
      * 测试
      */
     public Map<String, Object> test(String roomUid, Integer userId) {
+        if (1 == 1) {
+            destroyExpiredLiveRoom();
+            return null;
+        }
         //test
         Map<String, Object> result = new HashMap<>();
         //点赞数