Skip to content

Optimize checking for existing ro-crate records #201

@daniel-thom

Description

@daniel-thom

Copilot made this suggestion:

"find_entity_for_file calls list_ro_crate_entities (fetching all entities for the workflow) to find a single record by file_id. In create_ro_crate_entity_for_file this is called once, and in create_ro_crate_entity_for_output_file it is called once more, meaning for each file processed there is a full list fetch. For workflows with many entities this becomes an O(n) per-file lookup. Consider adding a dedicated API endpoint to look up an entity by file_id, or pass in a pre-fetched map of existing entities to these helpers."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions