fix: add more tokio::task::spawn_blocking
This commit is contained in:
+2
-3
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user