Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit ac6226de authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Mathieu Giraud


Added a script whichs clears duplicate sequence_file-config pairs from
the results_file table. The most recent entry containing said pair is
kept. Scheduler tasks associated to the deleted entries are also
parent 473be921
import argparse
parser = argparse.ArgumentParser(description='Process results and scheduler tasks that are no longer in use.')
parser.add_argument('--assume-yes', action='store_true', help='assume yes on all choices')
args = parser.parse_args()
def prompt(question):
affir = ['y', 'yes']
negat = ['n', 'no']
confirm = affir[0] if args.assume_yes else ""
while (confirm.lower() not in affir + negat):
if confirm != "":
print "Invalid option."
confirm = raw_input(question)
if confirm == "":
confirm = negat[0]
if confirm in affir:
return True
elif confirm in negat:
return False
raise Exception('Illegal State')
results_files = db( == db.results_file.sequence_file_id
prev_sfid = -1
prev_cid = -1
for row in results_files:
if row.sequence_file_id != prev_sfid or row.config_id != prev_cid:
targets = (
(db.results_file.sequence_file_id == row.sequence_file_id) &
(db.results_file.config_id == row.config_id) &
( !=
if db(targets).count() > 0:
print "Conserving: %d" %
task_targets = (targets &
( == db.results_file.scheduler_task_id)
task_ids = [ for r in db(task_targets).select(]
print "Removing scheduler tasks: %s" % str(task_ids)
choice = prompt("confirm deleting these %d scheduler tasks ? [y/N]" % len(task_ids))
if choice:
for target in db(targets).select(db.results_file.scheduler_task_id):
db( == target.scheduler_task_id).delete()
result_ids = [ for r in db(targets).select(]
print "Removing results_files: %s" % str(result_ids)
choice = prompt("confirm deleting these %d results files ? [y/N]" % len(result_ids))
if choice:
prev_sfid = row.sequence_file_id
prev_cid = row.config_id
Markdown is supported
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