fix: add more tokio::task::spawn_blocking

This commit is contained in:
monosans
2025-10-01 09:24:55 +03:00
parent 55095173f2
commit b0306c9ec7
5 changed files with 17 additions and 14 deletions
+2 -3
View File
@@ -182,10 +182,9 @@ impl DbType {
self,
) -> crate::Result<maxminddb::Reader<maxminddb::Mmap>> {
let path = self.db_path().await?;
let name = self.name();
tokio::task::spawn_blocking(move || {
maxminddb::Reader::open_mmap(path).wrap_err_with(move || {
format!("failed to open IP database: {name}")
maxminddb::Reader::open_mmap(&path).wrap_err_with(move || {
format!("failed to open IP database: {}", path.display())
})
})
.await?