akshetpandey commented on code in PR #67219:
URL: https://github.com/apache/airflow/pull/67219#discussion_r3270589622


##########
providers/google/src/airflow/providers/google/cloud/triggers/cloud_run.py:
##########
@@ -112,11 +113,17 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
         timeout = self.timeout
         self.hook = self._get_async_hook()
         while timeout is None or timeout > 0:
-            operation = await self.hook.get_operation(
-                operation_name=self.operation_name,
-                location=self.location,
-                use_regional_endpoint=self.use_regional_endpoint,
-            )
+            try:
+                operation = await self.hook.get_operation(
+                    operation_name=self.operation_name,
+                    location=self.location,
+                    use_regional_endpoint=self.use_regional_endpoint,
+                )
+            except ServiceUnavailable as e:
+                self.log.warning("Cloud Run API is temporarily unavailable. 
Retrying... (%s)", e)
+                await asyncio.sleep(self.polling_period_seconds)
+                continue

Review Comment:
   Done this way to be consistent with #66293 but I can change it



-- 
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