mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-13 08:31:59 -05:00
Handling the bad/lost connection of a database server.
Made backend changes for: * Taking care of the connection status in the psycopg2 driver. And, when the connection is lost, it throws a exception with 503 http status message, and connection lost information in it. * Allowing the flask application to propagate the exceptions even in the release mode. * Utilising the existing password (while reconnection, if not disconnected explicitly). * Introduced a new ajax response message 'service_unavailable' (http status code: 503), which suggests temporary service unavailable. Client (front-end) changes: * To handle the connection lost of a database server for different operations by generating proper events, and handle them properly. Removed the connection status check code from different nodes, so that - it generates the proper exception, when accessing the non-alive connection. Fixes #1387
This commit is contained in:
1 parent
1b05464a04
commit
f12d981a9d
51 files changed
+1235
-970
No files matched your search
@@ -1,6 +1,7 @@
|
||||
define(
|
||||
['underscore', 'underscore.string', 'jquery', 'pgadmin.browser'],
|
||||
function(_, S, $, pgBrowser) {
|
||||
define([
|
||||
'underscore', 'underscore.string', 'jquery', 'pgadmin.browser',
|
||||
'alertify', 'pgadmin.alertifyjs'
|
||||
], function(_, S, $, pgBrowser, Alertify) {
|
||||
|
||||
if (pgBrowser.ShowNodeDepends)
|
||||
return pgBrowser.ShowNodeDepends;
|
||||
@@ -226,7 +227,30 @@ define(
|
||||
$gridContainer.removeClass('hidden');
|
||||
// Set the url, fetch the data and update the collection
|
||||
collection.url = url;
|
||||
collection.fetch({ reset: true });
|
||||
collection.fetch({
|
||||
reset: true,
|
||||
error: function(coll, xhr, error, message) {
|
||||
var _label = treeHierarchy[n_type].label;
|
||||
pgBrowser.Events.trigger(
|
||||
'pgadmin:node:retrieval:error', 'depends', xhr, status, error
|
||||
);
|
||||
if (
|
||||
!Alertify.pgHandleItemError(xhr, error, message, {
|
||||
item: item, info: treeHierarchy
|
||||
})
|
||||
) {
|
||||
Alertify.pgNotifier(
|
||||
status, xhr,
|
||||
S(
|
||||
pgBrowser.messages['ERR_RETRIEVAL_INFO']
|
||||
).sprintf(message || _label).value(),
|
||||
function() {
|
||||
console.log(arguments);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (msg != '') {
|
||||
|
||||
Reference in new issue
Block a user