stop log if fail to record server stats

This commit is contained in:
mbecker20
2024-01-07 15:23:53 -08:00
parent 7ed115cddb
commit f0baa7496f

View File

@@ -34,9 +34,11 @@ impl State {
}
})
.collect::<Vec<_>>();
let res = self.db.stats.insert_many(records, None).await;
if let Err(e) = res {
error!("failed to record server stats | {e:#?}");
if !records.is_empty() {
let res = self.db.stats.insert_many(records, None).await;
if let Err(e) = res {
error!("failed to record server stats | {e:#?}");
}
}
}
}