|
|
@@ -864,9 +864,9 @@ public class Task {
|
|
|
// 获取用户的在线观看时长
|
|
|
String entryTimeKey = String.format(USER_ENTRY_TIME_KEY, liveId, userId);
|
|
|
Long existingEntryTime = redisCache.getCacheObject(entryTimeKey);
|
|
|
- Long onlineSeconds = user.getOnlineSeconds();
|
|
|
- if((onlineSeconds == null || onlineSeconds <= 0) && null != existingEntryTime){
|
|
|
- onlineSeconds = (System.currentTimeMillis() - existingEntryTime)/1000;
|
|
|
+ Long onlineSeconds = user.getOnlineSeconds() ==null ? 0L : user.getOnlineSeconds();
|
|
|
+ if(null != existingEntryTime){
|
|
|
+ onlineSeconds = onlineSeconds + ((System.currentTimeMillis() - existingEntryTime)/1000);
|
|
|
}
|
|
|
if (onlineSeconds == null || onlineSeconds <= 0) {
|
|
|
continue;
|