Skip to content

Commit

Permalink
Avoid blocking event loop when using DataFusionAsyncHook by replacing…
Browse files Browse the repository at this point in the history
… sleep by asyncio.sleep (#33756)
  • Loading branch information
hussein-awala committed Aug 26, 2023
1 parent 2a00f18 commit 3d01919
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/providers/google/cloud/hooks/datafusion.py
Expand Up @@ -17,6 +17,7 @@
"""This module contains Google DataFusion hook."""
from __future__ import annotations

import asyncio
import json
import os
from time import monotonic, sleep
Expand Down Expand Up @@ -528,7 +529,7 @@ async def _get_link(self, url: str, session):
break
except Exception as exc:
if "404" in str(exc):
sleep(time_to_wait)
await asyncio.sleep(time_to_wait)
else:
raise
if pipeline:
Expand Down

0 comments on commit 3d01919

Please sign in to comment.