dejii commented on code in PR #56400:
URL: https://github.com/apache/airflow/pull/56400#discussion_r2405587313


##########
providers/google/src/airflow/providers/google/cloud/triggers/pubsub.py:
##########
@@ -86,26 +86,22 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
         )
 
     async def run(self) -> AsyncIterator[TriggerEvent]:
-        try:
-            while True:
-                if pulled_messages := await self.hook.pull(
-                    project_id=self.project_id,
-                    subscription=self.subscription,
-                    max_messages=self.max_messages,
-                    return_immediately=True,
-                ):
-                    if self.ack_messages:
-                        await self.message_acknowledgement(pulled_messages)
+        while True:
+            if pulled_messages := await self.hook.pull(
+                project_id=self.project_id,
+                subscription=self.subscription,
+                max_messages=self.max_messages,
+                return_immediately=True,
+            ):
+                if self.ack_messages:
+                    await self.message_acknowledgement(pulled_messages)
 
-                    messages_json = [ReceivedMessage.to_dict(m) for m in 
pulled_messages]
+                messages_json = [ReceivedMessage.to_dict(m) for m in 
pulled_messages]
 
-                    yield TriggerEvent({"status": "success", "message": 
messages_json})
-                    return
-                self.log.info("Sleeping for %s seconds.", self.poke_interval)
-                await asyncio.sleep(self.poke_interval)
-        except Exception as e:
-            yield TriggerEvent({"status": "error", "message": str(e)})
-            return
+                yield TriggerEvent({"status": "success", "message": 
messages_json})
+                break

Review Comment:
   Reverted now.
   
   > Can you please also provide screenshots of system tests executions?
   ```bash
   pytest --system 
providers/google/tests/system/google/cloud/pubsub/example_pubsub_deferrable.py 
-sv
   ```
   <img width="1365" height="236" alt="image" 
src="https://github.com/user-attachments/assets/23a1a301-cf31-4169-bb1c-f842e0532e65";
 />
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to