mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure we handle external processes that fail to start. Fixes #1679
This commit is contained in:
parent
8e9108e0f3
commit
e6d018c44f
@ -209,9 +209,17 @@ class BatchProcess(object):
|
||||
)
|
||||
|
||||
self.ecode = p.poll()
|
||||
if self.ecode is not None:
|
||||
# TODO:: Couldn't start execution
|
||||
pass
|
||||
if self.ecode is not None and self.ecode != 0:
|
||||
# TODO:// Find a way to read error from detached failed process
|
||||
|
||||
# Couldn't start execution
|
||||
p = Process.query.filter_by(
|
||||
pid=self.id, user_id=current_user.id
|
||||
).first()
|
||||
p.start_time = p.end_time = get_current_time()
|
||||
if not p.exit_code:
|
||||
p.exit_code = self.ecode
|
||||
db.session.commit()
|
||||
|
||||
def status(self, out=0, err=0):
|
||||
import codecs
|
||||
|
@ -220,8 +220,9 @@ function(_, S, $, pgBrowser, alertify, pgMessages) {
|
||||
setTimeout(function() { self.update(res); }, 10);
|
||||
},
|
||||
error: function(res) {
|
||||
// Try after some time
|
||||
setTimeout(function() { self.update(res); }, 10000);
|
||||
// Try after some time only if job id present
|
||||
if (res.status != 410)
|
||||
setTimeout(function() { self.update(res); }, 10000);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user