Skip to content

Commit

Permalink
Add return statement after yield in trigger (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro authored May 27, 2024
1 parent 027aa1f commit d8cbcd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fivetran_provider_async/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d8cbcd2

Please sign in to comment.