You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diesel = { version = "1.4.8", features = ["postgres","chrono","uuid"] }
deadpool-diesel = { version = "0.3.1", features=["postgres","serde","rt_tokio_1"]}
code
let manager = Manager::new(&database_url, Runtime::Tokio1);
let pool = Pool::builder(manager)
.max_size(max_connections)
.wait_timeout(Some(Duration::from_millis(5000)))
.create_timeout(Some(Duration::from_millis(5000)))
.recycle_timeout(Some(Duration::from_millis(5000)))
.build()?;
error:
Error occurred while building the pool: NoRuntimeSpecified: Timeouts require a runtime'
Why, I have a specified runtime
The text was updated successfully, but these errors were encountered:
That's quite unfortunate. The Manager and the Pool are separate structures.
For the PoolBuilder to know the Runtime you need to call .runtime(Runtime::Tokio) on it as well.
This might indeed be a convenience feature if the PoolBuilder could read the runtime from the Manager object. Right now the Pool has no way of knowing which Runtime was passed to the Manager and therefore you need to call that method on the PoolBuilder as well.
The way managers and pools are constructed have always bugged me. I just created issue #197 to track the progress of this.
toml:
code
error:
Why, I have a specified runtime
The text was updated successfully, but these errors were encountered: