fix: 修复历史会话为负数的情况 (#11472)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-08-30 18:18:08 +08:00
committed by GitHub
parent 266a360a97
commit 51910ea2c1

View File

@@ -360,8 +360,9 @@ class IndexApi(DateTimeMixin, DatesLoginMetricMixin, APIView):
})
if _all or query_params.get('total_count') or query_params.get('total_count_history_sessions'):
count = self.sessions_amount - caches.total_count_online_sessions
data.update({
'total_count_history_sessions': self.sessions_amount - caches.total_count_online_sessions,
'total_count_history_sessions': count if count > 0 else 0,
})
if _all or query_params.get('total_count') or query_params.get('total_count_ftp_logs'):