()
| 82 | } |
| 83 | |
| 84 | pub async fn get_async_db_conn() -> Result<AsyncSqlitePoolConnection> { |
| 85 | let pool = get_async_db_pool()?; |
| 86 | |
| 87 | let start = Instant::now(); |
| 88 | let res = pool.get().await?; |
| 89 | |
| 90 | STORAGE_SQLITE_CONN_GET.observe(start.elapsed().as_secs_f64()); |
| 91 | |
| 92 | Ok(res) |
| 93 | } |
| 94 | |
| 95 | fn set_async_db_pool(p: AsyncSqlitePool) { |
| 96 | let mut pool_w = ASYNC_SQLITE_POOL.write().unwrap(); |