mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that "pause replay of wal"/"resume replay of wal" are enabled/disabled appropriately. #6026
This commit is contained in:
parent
8ea3346a9d
commit
30107e38f3
@ -1793,7 +1793,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
try:
|
try:
|
||||||
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
||||||
conn = manager.connection()
|
conn = manager.connection()
|
||||||
|
msg = None
|
||||||
# Execute SQL to pause or resume WAL replay
|
# Execute SQL to pause or resume WAL replay
|
||||||
if conn.connected():
|
if conn.connected():
|
||||||
if pause:
|
if pause:
|
||||||
@ -1806,6 +1806,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
return internal_server_error(
|
return internal_server_error(
|
||||||
errormsg=str(res)
|
errormsg=str(res)
|
||||||
)
|
)
|
||||||
|
msg = gettext('WAL replay paused')
|
||||||
else:
|
else:
|
||||||
sql = "SELECT pg_xlog_replay_resume();"
|
sql = "SELECT pg_xlog_replay_resume();"
|
||||||
if manager.version >= 100000:
|
if manager.version >= 100000:
|
||||||
@ -1816,9 +1817,10 @@ class ServerNode(PGChildNodeView):
|
|||||||
return internal_server_error(
|
return internal_server_error(
|
||||||
errormsg=str(res)
|
errormsg=str(res)
|
||||||
)
|
)
|
||||||
|
msg = gettext('WAL replay resumed')
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
success=1,
|
success=1,
|
||||||
info=gettext('WAL replay paused'),
|
info=msg,
|
||||||
data={'in_recovery': True, 'wal_pause': pause}
|
data={'in_recovery': True, 'wal_pause': pause}
|
||||||
)
|
)
|
||||||
return gone(errormsg=gettext('Please connect the server.'))
|
return gone(errormsg=gettext('Please connect the server.'))
|
||||||
|
@ -380,7 +380,7 @@ define('pgadmin.node.server', [
|
|||||||
getApiInstance().delete(
|
getApiInstance().delete(
|
||||||
obj.generate_url(i, 'wal_replay' , d, true)
|
obj.generate_url(i, 'wal_replay' , d, true)
|
||||||
).then(({data: res})=> {
|
).then(({data: res})=> {
|
||||||
obj.on_done(res, t, i);
|
obj.callbacks.on_done(res, t, i);
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
Notify.pgRespErrorNotify(error);
|
Notify.pgRespErrorNotify(error);
|
||||||
t.unload(i);
|
t.unload(i);
|
||||||
@ -401,7 +401,7 @@ define('pgadmin.node.server', [
|
|||||||
getApiInstance().put(
|
getApiInstance().put(
|
||||||
obj.generate_url(i, 'wal_replay' , d, true)
|
obj.generate_url(i, 'wal_replay' , d, true)
|
||||||
).then(({data: res})=> {
|
).then(({data: res})=> {
|
||||||
obj.on_done(res, t, i);
|
obj.callbacks.on_done(res, t, i);
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
Notify.pgRespErrorNotify(error);
|
Notify.pgRespErrorNotify(error);
|
||||||
t.unload(i);
|
t.unload(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user