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

Co-authored-by: feng <1304903146@qq.com>
pull/11474/head^2
fit2bot 2023-08-30 18:18:08 +08:00 committed by GitHub
parent 266a360a97
commit 51910ea2c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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'):