Skip to content
Snippets Groups Projects
Commit 1a1b0f20 authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

Merge branch 'scan-task-status' into 'master'

Set scan processing status while waiting for a worker

See merge request zesje/zesje!149
parents c63f7aed 8ecedf4f
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ class Scans(Resource):
return dict(status=404, message='Exam does not exist.'), 404
scan = Scan(exam=exam, name=args['pdf'].filename,
status='processing', message='importing PDF')
status='processing', message='Waiting...')
db.session.add(scan)
db.session.commit()
......
......@@ -67,6 +67,8 @@ def _process_pdf(scan_id, app_config):
# Raises exception if zero or more than one scans found
scan = Scan.query.filter(Scan.id == scan_id).one()
report_progress('Importing PDF')
pdf_path = os.path.join(data_directory, 'scans', f'{scan.id}.pdf')
output_directory = os.path.join(data_directory, f'{scan.exam.id}_data')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment