Fixed an issue where user is not able to cancel or terminate active queries from dashboard. #7078

This commit is contained in:
Pravesh Sharma 2023-12-29 15:40:36 +05:30 committed by GitHub
parent e837de5e8f
commit fd8af4034a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -695,6 +695,8 @@ function Dashboard({
? treeNodeInfo.server.user.can_signal_backend
: false;
let maintenanceActiveSessions = dashData.filter((data) => data.state === 'active'&&
maintenance_database === data.datname);
if (
treeNodeInfo.server &&
treeNodeInfo.server.user &&
@ -727,7 +729,8 @@ function Dashboard({
// If it is the last active connection on maintenance db then error out
} else if (
maintenance_database == row.original.datname &&
row.original.state == 'active'
row.original.state == 'active' &&
maintenanceActiveSessions.length === 1
) {
if (is_cancel_session) {
txtMessage = gettext(