message: In pgsql plugin deprecate config option min_idle_time, supersede by  min_idle_count
diff: @@ -367,7 +367,8 @@ pub struct PostgresConfig {
  url: String,
  tls: Option<String>, // default off
  max_connections: Option<u32>, // default 5
  - min_idle_time: Option<u32>, // default 0
  + min_idle_time: Option<u32>, // default 0, deprecated
  + min_idle_count: Option<u32>, // default 0
  connection_timeout: Option<u64>, // default 5
  wallet_scheme: Option<WalletScheme>, // default DatabasePerWallet
  }
  @@ -397,18 +398,27 @@ impl PostgresConfig {
  None => TlsMode::None
  }
  }
  + /// Sets the maximum number of connections managed by the pool.
  fn max_connections(&self) -> u32 {
  match &self.max_connections {
  Some(conn) => *conn,
  None => 5
  }
  }
  - fn min_idle_time(&self) -> u32 {
  - match &self.min_idle_time {
  - Some(idle) => *idle,
  + /// Sets the minimum idle connection count maintained by the pool.
  + fn min_idle_count(&self) -> u32 {
  + match self.min_idle_count {
  + Some(idle_count) => idle_count,
  + None => match self.min_idle_time {
  + Some(idle_count_deprecated) => {
  + warn!("Configuration option min_idle_time is deprecated. Use min_idle_count instead.");
  + idle_count_deprecated
  + },
  None => 0
  }
  }
  + }
  + /// Sets the idle timeout used by the pool.
  fn connection_timeout(&self) -> u64 {
  match &self.connection_timeout {
  Some(timeout) => *timeout,
  @@ -547,7 +557,11 @@ impl WalletStrategy for DatabasePerWalletStrategy {
  Ok(manager) => manager,
  Err(_) => return Err(WalletStorageError::NotFound)
  };
  - let pool = match r2d2::Pool::builder().min_idle(Some(config.min_idle_time())).max_size(config.max_connections()).idle_timeout(Some(Duration::new(config.connection_timeout(), 0))).build(manager) {
  + let pool = match r2d2::Pool::builder()
  + .min_idle(Some(config.min_idle_count()))
  + .max_size(config.max_connections())
  + .idle_timeout(Some(Duration::new(config.connection_timeout(), 0)))
  + .build(manager) {
  Ok(pool) => pool,
  Err(_) => return Err(WalletStorageError::NotFound)
  };
  @@ -703,7 +717,11 @@ impl WalletStrategy for MultiWalletSingleTableStrategy {
  Ok(manager) => manager,
  Err(_) => return Err(WalletStorageError::NotFound)
  };
  - let pool = match r2d2::Pool::builder().min_idle(Some(config.min_idle_time())).max_size(config.max_connections()).idle_timeout(Some(Duration::new(config.connection_timeout(), 0))).build(manager) {
  + let pool = match r2d2::Pool::builder()
  + .min_idle(Some(config.min_idle_count()))
  + .max_size(config.max_connections())
  + .idle_timeout(Some(Duration::new(config.connection_timeout(), 0)))
  + .build(manager) {
  Ok(pool) => pool,
  Err(_) => return Err(WalletStorageError::NotFound)
  };
  @@ -2304,7 +2322,7 @@ mod tests {
  "url": "localhost:5432".to_owned(),
  "tls": "None",
  "max_connections": 4,
  - "min_idle_time": 0,
  + "min_idle_count": 0,
  "connection_timeout": 10
  }).to_string();
  config
  