mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
fix(sqllab): Add threshold for checking inactive queries (#24536)
Co-authored-by: Justin Park <justinpark@apache.org>
This commit is contained in:
parent
19deb9141d
commit
8ba0b81957
@ -201,8 +201,8 @@ export function estimateQueryCost(queryEditor) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function clearInactiveQueries() {
|
export function clearInactiveQueries(interval) {
|
||||||
return { type: CLEAR_INACTIVE_QUERIES };
|
return { type: CLEAR_INACTIVE_QUERIES, interval };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startQuery(query) {
|
export function startQuery(query) {
|
||||||
|
@ -92,7 +92,7 @@ function QueryAutoRefresh({
|
|||||||
}, {}) ?? {};
|
}, {}) ?? {};
|
||||||
dispatch(refreshQueries(queries));
|
dispatch(refreshQueries(queries));
|
||||||
} else {
|
} else {
|
||||||
dispatch(clearInactiveQueries());
|
dispatch(clearInactiveQueries(QUERY_UPDATE_FREQ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -102,7 +102,7 @@ function QueryAutoRefresh({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!cleanInactiveRequestRef.current && !shouldRequestChecking) {
|
if (!cleanInactiveRequestRef.current && !shouldRequestChecking) {
|
||||||
dispatch(clearInactiveQueries());
|
dispatch(clearInactiveQueries(QUERY_UPDATE_FREQ));
|
||||||
cleanInactiveRequestRef.current = true;
|
cleanInactiveRequestRef.current = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -647,6 +647,7 @@ export default function sqlLabReducer(state = {}, action) {
|
|||||||
Object.entries(queries).filter(([, query]) => {
|
Object.entries(queries).filter(([, query]) => {
|
||||||
if (
|
if (
|
||||||
['running', 'pending'].includes(query.state) &&
|
['running', 'pending'].includes(query.state) &&
|
||||||
|
Date.now() - query.startDttm > action.interval &&
|
||||||
query.progress === 0
|
query.progress === 0
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user