Skip to content

Commit

Permalink
Fix and prevent persisting null file_size
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 15, 2023
1 parent 1f79be7 commit 316a20b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/galaxy/metadata/set_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ def set_meta(new_dataset_instance, file_dict):
partial(push_if_necessary, object_store, dataset, external_filename)
)
object_store_update_actions.append(partial(reset_external_filename, dataset))
object_store_update_actions.append(partial(dataset.set_total_size))
object_store_update_actions.append(partial(export_store.add_dataset, dataset))
if dataset_instance_id not in unnamed_id_to_path:
object_store_update_actions.append(partial(collect_extra_files, object_store, dataset, "."))
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def versioned_objects_strict(iter):
raise Exception(f"HistoryDatsetAssociation {obj} without history detected, this is not valid")
elif not obj.hid:
raise Exception(f"HistoryDatsetAssociation {obj} without hid, this is not valid")
elif obj.dataset.file_size is None:
elif obj.dataset.file_size is None and obj.dataset.in_ready_state():
raise Exception(f"HistoryDatsetAssociation {obj} with null file size, this is not valid")
yield obj

Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/model/store/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ def set_datasets_metadata(datasets, datasets_attributes=None):
except Exception:
log.exception("Exception occured while setting dataset peek")

primary_data.set_total_size()

def populate_collection_elements(
self,
collection,
Expand Down

0 comments on commit 316a20b

Please sign in to comment.