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:
Akshay Joshi
2018-10-22 12:35:21 +05:30
parent 370df47042
commit 6bc6bc7f60
49 changed files with 731 additions and 101 deletions

View File

@@ -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))