From 5d8908089ecfe9009dc5f6eb1de95ff5071e4d43 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Mon, 16 Dec 2024 10:18:08 -0600 Subject: [PATCH] Extend retry interval --- packages/tapisui-api/src/utils/apiGenerator.ts | 4 +++- src/app/Jobs/JobDetail/JobDetail.tsx | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/tapisui-api/src/utils/apiGenerator.ts b/packages/tapisui-api/src/utils/apiGenerator.ts index 51cbb0116..0d68a8131 100644 --- a/packages/tapisui-api/src/utils/apiGenerator.ts +++ b/packages/tapisui-api/src/utils/apiGenerator.ts @@ -14,7 +14,9 @@ const apiGenerator = ( basePath: string, jwt: string | null ): T => { - const headers: any = {}; + const headers: any = { + 'X-Client-Identifier': 'TapisUI', + }; if (jwt) { headers['X-Tapis-Token'] = jwt; } diff --git a/src/app/Jobs/JobDetail/JobDetail.tsx b/src/app/Jobs/JobDetail/JobDetail.tsx index 5ca04da59..44b699212 100644 --- a/src/app/Jobs/JobDetail/JobDetail.tsx +++ b/src/app/Jobs/JobDetail/JobDetail.tsx @@ -76,7 +76,7 @@ const JobOutputList: React.FC<{ job: Jobs.Job }> = ({ job }) => { const JobDetail: React.FC<{ jobUuid: string }> = ({ jobUuid }) => { const [isCanceled, setIsCanceled] = useState(false); const [showJSON, setShowJSON] = useState(false); - const [refetchInterval, setRefetchInterval] = useState(0); + const [refetchInterval, setRefetchInterval] = useState(5); const { data, isLoading, error } = Hooks.useDetails(jobUuid, { refetchInterval: refetchInterval * 1000, }); @@ -99,16 +99,16 @@ const JobDetail: React.FC<{ jobUuid: string }> = ({ jobUuid }) => { } if ( - refetchInterval === 0 && + refetchInterval === 5 && job?.status && !jobRunningStatuses.includes(job?.status) ) { - setRefetchInterval(1); + setRefetchInterval(10); return; } if (jobRunningStatuses.includes(job?.status!)) { - setRefetchInterval(refetchInterval * 2); + setRefetchInterval(refetchInterval * 1.5); } }, [data]); @@ -228,7 +228,7 @@ const JobDetail: React.FC<{ jobUuid: string }> = ({ jobUuid }) => { { jobUuid: job?.uuid! }, { onSuccess: () => { - setRefetchInterval(1); + setRefetchInterval(5); }, } );