Commit 9a0855a9 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed issue with reoccuring calcs in re-process and indexing re-processed calcs with datasets.

parent d6fa8c46
Pipeline #52482 passed with stages
in 15 minutes and 7 seconds
...@@ -73,7 +73,8 @@ class Calc(Proc): ...@@ -73,7 +73,8 @@ class Calc(Proc):
('upload_id', 'mainfile'), ('upload_id', 'mainfile'),
('upload_id', 'parser'), ('upload_id', 'parser'),
('upload_id', 'tasks_status'), ('upload_id', 'tasks_status'),
('upload_id', 'process_status') ('upload_id', 'process_status'),
('upload_id', 'metadata.nomad_version')
] ]
} }
...@@ -633,7 +634,10 @@ class Upload(Proc): ...@@ -633,7 +634,10 @@ class Upload(Proc):
self._continue_with('parse_all') self._continue_with('parse_all')
try: try:
for calc in Calc.objects(upload_id=self.upload_id): # we use a copy of the mongo queryset; reasons are cursor timeouts and
# changing results on modifying the calc entries
calcs = list(Calc.objects(upload_id=self.upload_id))
for calc in calcs:
if calc.process_running: if calc.process_running:
if calc.current_process == 're_process_calc': if calc.current_process == 're_process_calc':
logger.warn('re_process_calc is already running', calc_id=calc.calc_id) logger.warn('re_process_calc is already running', calc_id=calc.calc_id)
......
...@@ -64,7 +64,7 @@ class Dataset(InnerDoc): ...@@ -64,7 +64,7 @@ class Dataset(InnerDoc):
def from_dataset_popo(cls, dataset): def from_dataset_popo(cls, dataset):
return cls( return cls(
id=dataset.id, id=dataset.id,
doi=dataset.doi.value if dataset.doi is not None else None, doi=dataset.doi['value'] if dataset.doi is not None else None,
name=dataset.name) name=dataset.name)
id = Keyword() id = Keyword()
......
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