mirror of
https://github.com/pcvolkmer/bzkf-rwdp-check.git
synced 2025-04-19 19:16:51 +00:00
feat: limit connection timeout
This commit is contained in:
parent
f3c08a972b
commit
5a59deb75d
@ -37,7 +37,7 @@ impl DatabaseSource {
|
||||
pub fn check(&self, year: &str, ignore_exports_since: &str) -> Result<Vec<Icd10GroupSize>, ()> {
|
||||
match Pool::new(self.0.as_str()) {
|
||||
Ok(pool) => {
|
||||
if let Ok(mut connection) = pool.get_conn() {
|
||||
if let Ok(mut connection) = pool.try_get_conn(Duration::from_secs(3)) {
|
||||
return match connection.exec_map(
|
||||
SQL_QUERY,
|
||||
params! {"year" => year, "ignore_exports_since" => ignore_exports_since},
|
||||
@ -67,7 +67,7 @@ impl DatabaseSource {
|
||||
) -> Result<Vec<ExportData>, ()> {
|
||||
match Pool::new(self.0.as_str()) {
|
||||
Ok(pool) => {
|
||||
if let Ok(mut connection) = pool.get_conn() {
|
||||
if let Ok(mut connection) = pool.try_get_conn(Duration::from_secs(3)) {
|
||||
return match connection.exec_map(
|
||||
EXPORT_QUERY,
|
||||
params! {"year" => year, "ignore_exports_since" => ignore_exports_since},
|
||||
|
Loading…
x
Reference in New Issue
Block a user