Commit ea149509 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Removed and mark quick fixes that are unecessary or bad.

parent d8d18623
......@@ -413,12 +413,15 @@ class Upload(Chord):
def all_calcs(self, start, end, order_by='mainfile'):
return Calc.objects(upload_id=self.upload_id)[start:end].order_by(order_by)
def repair_all():
Utitlity function that will look for suspiciously looking conditions in
all uncompleted downloads. It ain't a perfect world.
# TODO this was added as a quick fix to #37.
# Even though it might be strictly necessary, there should be a tested backup
# solution for it Chords to not work properly due to failed to fail processings
uploads = Upload.objects(status__in=[PENDING, RUNNING])
for upload in uploads:
completed = upload.processed_calcs
from import Upload
import time
if __name__ == '__main__':
suspicious = {}
while True:
for upload in Upload.objects(status='RUNNING', current_task='parse_all'):
if upload.total_calcs == upload.processed_calcs:
if upload.upload_id in suspicious:
upload.status = 'SUCCESS'
print('Fixed suspicious %s' % upload.upload_id)
print('Found suspicious %s' % upload.upload_id)
suspicious[upload.upload_id] = upload.upload_id
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