Commit aea98511 authored by Andreas Valder's avatar Andreas Valder
Browse files

one transaction per course

parent 2c308f06
...@@ -57,10 +57,10 @@ def schedule_thumbnail(lectureid): ...@@ -57,10 +57,10 @@ def schedule_thumbnail(lectureid):
@mod_required @mod_required
@sched_func(600) @sched_func(600)
def sort_now(): def sort_now():
modify('BEGIN')
courses = query('SELECT * FROM courses') courses = query('SELECT * FROM courses')
formats = query('SELECT * FROM formats ORDER BY prio') formats = query('SELECT * FROM formats ORDER BY prio')
for course in courses: for course in courses:
modify('BEGIN')
for mountpoint in config['VIDEOMOUNT']: for mountpoint in config['VIDEOMOUNT']:
existingvideos = query('SELECT videos.path FROM videos JOIN lectures ON (videos.lecture_id = lectures.id) WHERE lectures.course_id = ?',course['id']) existingvideos = query('SELECT videos.path FROM videos JOIN lectures ON (videos.lecture_id = lectures.id) WHERE lectures.course_id = ?',course['id'])
knownerrors = query('SELECT sorterrorlog.path FROM sorterrorlog WHERE sorterrorlog.course_id = ?',course['id']) knownerrors = query('SELECT sorterrorlog.path FROM sorterrorlog WHERE sorterrorlog.course_id = ?',course['id'])
...@@ -168,7 +168,7 @@ def sort_now(): ...@@ -168,7 +168,7 @@ def sort_now():
traceback.print_exc() traceback.print_exc()
modify('COMMIT') modify('COMMIT')
if 'ref' in request.values: if 'ref' in request.values:
return redirect(request.values['ref']) return redirect(request.values['ref'])
else: else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment