mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 07:58:06 +00:00
MINOR: fix test connection showing timeout even after being successfull (#20260)
* fix test connection showing timeout even after being successfull * clear the timeout if the execution is being finished and reverted the last commit changes
This commit is contained in:
parent
153358a216
commit
4ec19e56a9
@ -165,7 +165,7 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
setTestConnectionStepResult([]);
|
||||
setTestStatus(undefined);
|
||||
setIsConnectionTimeout(false);
|
||||
setProgress(0);
|
||||
setProgress(TEST_CONNECTION_PROGRESS_PERCENTAGE.ZERO);
|
||||
};
|
||||
|
||||
const handleDeleteWorkflow = async (workflowId: string) => {
|
||||
@ -206,6 +206,7 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
response: Workflow,
|
||||
intervalObject: {
|
||||
intervalId?: number;
|
||||
timeoutId?: number;
|
||||
}
|
||||
) => {
|
||||
// return a promise that wraps the interval and handles errors inside it
|
||||
@ -242,6 +243,7 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
|
||||
// clear the current interval
|
||||
clearInterval(intervalObject.intervalId);
|
||||
clearTimeout(intervalObject.timeoutId);
|
||||
|
||||
// set testing connection to false
|
||||
setIsTestingConnection(false);
|
||||
@ -269,6 +271,7 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
// current interval id
|
||||
const intervalObject: {
|
||||
intervalId?: number;
|
||||
timeoutId?: number;
|
||||
} = {};
|
||||
|
||||
try {
|
||||
@ -312,7 +315,7 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
}
|
||||
|
||||
// stop fetching the workflow after 2 minutes
|
||||
setTimeout(() => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
// clear the current interval
|
||||
clearInterval(intervalObject.intervalId);
|
||||
|
||||
@ -333,6 +336,8 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
setProgress(TEST_CONNECTION_PROGRESS_PERCENTAGE.HUNDRED);
|
||||
}, FETCHING_EXPIRY_TIME);
|
||||
|
||||
intervalObject.timeoutId = Number(timeoutId);
|
||||
|
||||
// Handle workflow polling and completion
|
||||
await handleWorkflowPolling(response, intervalObject);
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user