This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 3ac6f7ac049 Remove dag details requests from dag list page (#46382)
3ac6f7ac049 is described below

commit 3ac6f7ac049d3d4ae9d815b8f179f2c39a5c2aec
Author: Brent Bovenzi <[email protected]>
AuthorDate: Mon Feb 3 19:18:44 2025 -0500

    Remove dag details requests from dag list page (#46382)
---
 airflow/ui/src/pages/DagsList/DagCard.tsx | 2 +-
 airflow/ui/src/utils/query.ts             | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/airflow/ui/src/pages/DagsList/DagCard.tsx 
b/airflow/ui/src/pages/DagsList/DagCard.tsx
index b222b037c72..d99845cdb4b 100644
--- a/airflow/ui/src/pages/DagsList/DagCard.tsx
+++ b/airflow/ui/src/pages/DagsList/DagCard.tsx
@@ -38,7 +38,7 @@ type Props = {
 export const DagCard = ({ dag }: Props) => {
   const [latestRun] = dag.latest_dag_runs;
 
-  const refetchInterval = useAutoRefresh({ dagId: dag.dag_id });
+  const refetchInterval = useAutoRefresh({ isPaused: dag.is_paused });
 
   return (
     <Box borderColor="border.emphasized" borderRadius={8} borderWidth={1} 
overflow="hidden">
diff --git a/airflow/ui/src/utils/query.ts b/airflow/ui/src/utils/query.ts
index 0db7b895903..415d1a5c9fa 100644
--- a/airflow/ui/src/utils/query.ts
+++ b/airflow/ui/src/utils/query.ts
@@ -52,7 +52,7 @@ export const doQueryKeysMatch = (query: Query, 
queryKeysToMatch: Array<PartialQu
     : true;
 };
 
-export const useAutoRefresh = ({ dagId }: { dagId?: string }) => {
+export const useAutoRefresh = ({ dagId, isPaused }: { dagId?: string; 
isPaused?: boolean }) => {
   const autoRefreshInterval = useConfig("auto_refresh_interval") as number | 
undefined;
   const { data: dag } = useDagServiceGetDagDetails(
     {
@@ -62,7 +62,9 @@ export const useAutoRefresh = ({ dagId }: { dagId?: string }) 
=> {
     { enabled: dagId !== undefined },
   );
 
-  const canRefresh = autoRefreshInterval !== undefined && (dagId === undefined 
? true : !dag?.is_paused);
+  const paused = isPaused ?? dag?.is_paused;
+
+  const canRefresh = autoRefreshInterval !== undefined && (dagId === undefined 
? true : !paused);
 
   // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
   return (canRefresh ? autoRefreshInterval * 1000 : false) as number | false;

Reply via email to