From 0d8a63cdfccc2e816d13d32615614a88d2623a70 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Thu, 27 Jul 2023 15:18:43 -0500 Subject: [PATCH] fix: check_notify --- postgres/src/generic_client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postgres/src/generic_client.rs b/postgres/src/generic_client.rs index 2c633afd..a757cb1b 100644 --- a/postgres/src/generic_client.rs +++ b/postgres/src/generic_client.rs @@ -1,5 +1,7 @@ #![allow(missing_docs)] +use std::time::Duration; + use fallible_iterator::FallibleIterator; use tokio_postgres::{Column, Notification}; use tokio_postgres::row::RowIndex; @@ -194,7 +196,7 @@ impl GenericClient for Client { fn check_for_notify(&mut self) -> Result, Self::Error> { let mut n = self.notifications(); - let mut n = n.iter(); + let mut n = n.timeout_iter(Duration::from_millis(500)); n.next() } }