mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that Utilities(Backup/Restore/Maintenence/Import-Export) should not be started
if binary path is wrong and also added 'Stop Process' button to cancel the process.
This commit is contained in:
@@ -44,7 +44,8 @@ class BGProcessModule(PgAdminModule):
|
||||
"""
|
||||
return [
|
||||
'bgprocess.status', 'bgprocess.detailed_status',
|
||||
'bgprocess.acknowledge', 'bgprocess.list'
|
||||
'bgprocess.acknowledge', 'bgprocess.list',
|
||||
'bgprocess.stop_process'
|
||||
]
|
||||
|
||||
|
||||
@@ -104,3 +105,18 @@ def acknowledge(pid):
|
||||
return success_return()
|
||||
except LookupError as lerr:
|
||||
return gone(errormsg=str(lerr))
|
||||
|
||||
|
||||
@blueprint.route('/stop/<pid>', methods=['PUT'], endpoint='stop_process')
|
||||
@login_required
|
||||
def stop_process(pid):
|
||||
"""
|
||||
User has stopped the process
|
||||
|
||||
:param pid: Process ID
|
||||
"""
|
||||
try:
|
||||
BatchProcess.stop_process(pid)
|
||||
return success_return()
|
||||
except LookupError as lerr:
|
||||
return gone(errormsg=str(lerr))
|
||||
|
||||
Reference in New Issue
Block a user