Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions upload_biomek_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ def main(args):
inst_id = conf["inst_id"]
biomek_logs_db = couch['biomek_logs']
db_view_run_finished = biomek_logs_db.view('names/run_finished')
run_finished_dict = {}
for row in db_view_run_finished:
run_finished_dict[(row.key[0], row.key[1])] = (row.value, row.id)

log_files_list = os.listdir(args.log_file_path)
logs_to_create = []
logs_to_update = []
save_docs = []
for fname in log_files_list:
if fname.startswith("Errors"):
if (not db_view_run_finished[[fname, inst_id]]):
if ((fname, inst_id) not in run_finished_dict):
logs_to_create.append(fname)
elif (db_view_run_finished[[fname, inst_id]].rows[0].value == False):
logs_to_update.append(db_view_run_finished[[fname, inst_id]].rows[0].id)
elif (run_finished_dict[(fname, inst_id)][0] == False):
logs_to_update.append(run_finished_dict[(fname, inst_id)][1])


for fname in logs_to_create:
Expand Down