fix (backend-rs): active users count in nodeinfo (close #10935)

This commit is contained in:
naskya 2024-05-21 16:12:07 +09:00
parent b06c739dba
commit f1e3395783
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -21,9 +21,9 @@ pub enum Error {
async fn statistics() -> Result<(u64, u64, u64, u64), DbErr> { async fn statistics() -> Result<(u64, u64, u64, u64), DbErr> {
let db = db_conn().await?; let db = db_conn().await?;
let now = chrono::Local::now().naive_local(); let now = chrono::Utc::now();
const MONTH: chrono::TimeDelta = chrono::Duration::seconds(2592000000); const MONTH: chrono::TimeDelta = chrono::Duration::days(30);
const HALF_YEAR: chrono::TimeDelta = chrono::Duration::seconds(15552000000); const HALF_YEAR: chrono::TimeDelta = chrono::Duration::days(183);
let local_users = user::Entity::find() let local_users = user::Entity::find()
.filter(user::Column::Host.is_null()) .filter(user::Column::Host.is_null())