mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -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:
|
||||
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
||||
conn = manager.connection()
|
||||
|
||||
msg = None
|
||||
# Execute SQL to pause or resume WAL replay
|
||||
if conn.connected():
|
||||
if pause:
|
||||
@ -1806,6 +1806,7 @@ class ServerNode(PGChildNodeView):
|
||||
return internal_server_error(
|
||||
errormsg=str(res)
|
||||
)
|
||||
msg = gettext('WAL replay paused')
|
||||
else:
|
||||
sql = "SELECT pg_xlog_replay_resume();"
|
||||
if manager.version >= 100000:
|
||||
@ -1816,9 +1817,10 @@ class ServerNode(PGChildNodeView):
|
||||
return internal_server_error(
|
||||
errormsg=str(res)
|
||||
)
|
||||
msg = gettext('WAL replay resumed')
|
||||
return make_json_response(
|
||||
success=1,
|
||||
info=gettext('WAL replay paused'),
|
||||
info=msg,
|
||||
data={'in_recovery': True, 'wal_pause': pause}
|
||||
)
|
||||
return gone(errormsg=gettext('Please connect the server.'))
|
||||
|
@ -380,7 +380,7 @@ define('pgadmin.node.server', [
|
||||
getApiInstance().delete(
|
||||
obj.generate_url(i, 'wal_replay' , d, true)
|
||||
).then(({data: res})=> {
|
||||
obj.on_done(res, t, i);
|
||||
obj.callbacks.on_done(res, t, i);
|
||||
}).catch(function(error) {
|
||||
Notify.pgRespErrorNotify(error);
|
||||
t.unload(i);
|
||||
@ -401,7 +401,7 @@ define('pgadmin.node.server', [
|
||||
getApiInstance().put(
|
||||
obj.generate_url(i, 'wal_replay' , d, true)
|
||||
).then(({data: res})=> {
|
||||
obj.on_done(res, t, i);
|
||||
obj.callbacks.on_done(res, t, i);
|
||||
}).catch(function(error) {
|
||||
Notify.pgRespErrorNotify(error);
|
||||
t.unload(i);
|
||||
|
Loading…
Reference in New Issue
Block a user