mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
use flush, refresh and rollback instead of intemediate commit statements
This commit is contained in:
parent
07191b36b2
commit
2b1a74efb8
@ -51,13 +51,13 @@ def service(service):
|
||||
service_version=form.version.data,
|
||||
status='preparing', title=form.title.data)
|
||||
db.session.add(job)
|
||||
db.session.commit()
|
||||
db.session.flush()
|
||||
db.session.refresh(job)
|
||||
try:
|
||||
os.makedirs(job.path)
|
||||
except OSError:
|
||||
logging.error('Make dir {} led to an OSError!'.format(job.path))
|
||||
db.session.delete(job)
|
||||
db.session.commit()
|
||||
db.session.rollback()
|
||||
flash('Internal Server Error', 'error')
|
||||
return make_response(
|
||||
{'redirect_url': url_for('.service', service=service)}, 500)
|
||||
|
Loading…
Reference in New Issue
Block a user