From d8cbcd2c002ef9267ede46a086943fbe50ca4491 Mon Sep 17 00:00:00 2001 From: Pankaj Singh <98807258+pankajastro@users.noreply.github.com> Date: Mon, 27 May 2024 17:38:56 +0530 Subject: [PATCH] Add return statement after yield in trigger (#94) --- fivetran_provider_async/triggers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fivetran_provider_async/triggers.py b/fivetran_provider_async/triggers.py index 697d775..4b94621 100644 --- a/fivetran_provider_async/triggers.py +++ b/fivetran_provider_async/triggers.py @@ -85,11 +85,14 @@ async def run(self) -> AsyncIterator["TriggerEvent"]: # type: ignore[override] "return_value": self.previous_completed_at.to_iso8601_string(), } ) + return elif res == "pending": self.log.info("sync is still running...") self.log.info("sleeping for %s seconds.", self.poke_interval) await asyncio.sleep(self.poke_interval) else: yield TriggerEvent({"status": "error", "message": "error"}) + return except Exception as e: yield TriggerEvent({"status": "error", "message": str(e)}) + return