mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Box the shared SQLite pool-opening future (#63331)
## What changed Have `open_read_write_pool_with_spec` return a pinned, boxed `Send` future. Keep the shared setup and recovery logic for runtime and standalone database callers in `open_pool_inner`. GitOrigin-RevId: 4ceca053e76fa1d497259c52c12d422fd3fa2554
This commit is contained in:
@@ -27,6 +27,7 @@ use sqlx::sqlite::SqlitePoolOptions;
|
||||
use sqlx::sqlite::SqliteSynchronous;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
@@ -474,7 +475,17 @@ impl SqliteConfig {
|
||||
.await
|
||||
}
|
||||
|
||||
async fn open_read_write_pool_with_spec(
|
||||
// Share SQLite setup and recovery between the runtime and standalone database owners.
|
||||
fn open_read_write_pool_with_spec<'a>(
|
||||
&'a self,
|
||||
path: &'a Path,
|
||||
recover_spec: Option<RuntimeDbSpec>,
|
||||
telemetry_override: Option<&'a dyn DbTelemetry>,
|
||||
) -> Pin<Box<dyn Future<Output = anyhow::Result<SqlitePool>> + Send + 'a>> {
|
||||
Box::pin(self.open_pool_inner(path, recover_spec, telemetry_override))
|
||||
}
|
||||
|
||||
async fn open_pool_inner(
|
||||
&self,
|
||||
path: &Path,
|
||||
recover_spec: Option<RuntimeDbSpec>,
|
||||
|
||||
Reference in New Issue
Block a user