Parse mysql timeout.wait property as duration (closes #202)
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
* for more details.
|
* for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use mysql_async::{prelude::Queryable, OptsBuilder, Pool, PoolConstraints, PoolOpts, SslOpts};
|
use mysql_async::{prelude::Queryable, OptsBuilder, Pool, PoolConstraints, PoolOpts, SslOpts};
|
||||||
use utils::config::utils::AsKey;
|
use utils::config::utils::AsKey;
|
||||||
|
|
||||||
@@ -44,7 +46,11 @@ impl MysqlStore {
|
|||||||
.to_string()
|
.to_string()
|
||||||
.into(),
|
.into(),
|
||||||
)
|
)
|
||||||
.wait_timeout(config.property((&prefix, "timeout.wait"))?);
|
.wait_timeout(
|
||||||
|
config
|
||||||
|
.property::<Duration>((&prefix, "timeout.wait"))?
|
||||||
|
.map(|t| t.as_secs() as usize),
|
||||||
|
);
|
||||||
if let Some(port) = config.property((&prefix, "port"))? {
|
if let Some(port) = config.property((&prefix, "port"))? {
|
||||||
opts = opts.tcp_port(port);
|
opts = opts.tcp_port(port);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user