Skip to content

Commit 40cb51d

Browse files
dstandishkaxil
authored andcommitted
Use sync calls for list backfills (#49454)
We found issues when running this with pg bouncer. We can make it sync until we sort that stuff out. (cherry picked from commit 01ed94b)
1 parent b71c0f5 commit 40cb51d

File tree

1 file changed

+5
-6
lines changed
  • airflow-core/src/airflow/api_fastapi/core_api/routes/public

1 file changed

+5
-6
lines changed

airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424

2525
from airflow.api_fastapi.auth.managers.models.resource_details import DagAccessEntity
2626
from airflow.api_fastapi.common.db.common import (
27-
AsyncSessionDep,
2827
SessionDep,
29-
paginated_select_async,
28+
paginated_select,
3029
)
3130
from airflow.api_fastapi.common.parameters import QueryLimit, QueryOffset, SortParam
3231
from airflow.api_fastapi.common.router import AirflowRouter
@@ -67,24 +66,24 @@
6766
Depends(requires_access_backfill(method="GET")),
6867
],
6968
)
70-
async def list_backfills(
69+
def list_backfills(
7170
dag_id: str,
7271
limit: QueryLimit,
7372
offset: QueryOffset,
7473
order_by: Annotated[
7574
SortParam,
7675
Depends(SortParam(["id"], Backfill).dynamic_depends()),
7776
],
78-
session: AsyncSessionDep,
77+
session: SessionDep,
7978
) -> BackfillCollectionResponse:
80-
select_stmt, total_entries = await paginated_select_async(
79+
select_stmt, total_entries = paginated_select(
8180
statement=select(Backfill).where(Backfill.dag_id == dag_id),
8281
order_by=order_by,
8382
offset=offset,
8483
limit=limit,
8584
session=session,
8685
)
87-
backfills = await session.scalars(select_stmt)
86+
backfills = session.scalars(select_stmt)
8887
return BackfillCollectionResponse(
8988
backfills=backfills,
9089
total_entries=total_entries,

0 commit comments

Comments
 (0)