Skip to content

[MAINTENANCE] Extract document retrieval logic in ReindexCommand#1993

Open
beatrycze-volk wants to merge 2 commits into
kitodo:mainfrom
beatrycze-volk:reindex
Open

[MAINTENANCE] Extract document retrieval logic in ReindexCommand#1993
beatrycze-volk wants to merge 2 commits into
kitodo:mainfrom
beatrycze-volk:reindex

Conversation

@beatrycze-volk

Copy link
Copy Markdown
Collaborator

Depends on #1991

…eindexCommand`

The `--use-cache` option allows the reindex command to retrieve document data from the cache if available, potentially speeding up reindexing by avoiding redundant data loading.

Additionally, the cache clearing mechanism has been optimized. Instead of flushing the entire document cache for each reindexed item, only the specific document's cache entry is now removed. This prevents unnecessary invalidation of unrelated cache entries and improves performance during reindexing.
@beatrycze-volk beatrycze-volk self-assigned this Jun 5, 2026
@beatrycze-volk beatrycze-volk added the ⟳ maintenance A task to keep the code up-to-date and manageable. label Jun 5, 2026
The `execute` method of the `ReindexCommand` contained duplicated logic for fetching documents based on different CLI options (all documents vs. by collections, with or without limit/offset). This change extracts this common logic into dedicated private methods (`getAllDocuments` and `getCollectionsDocuments`).

This improves readability and maintainability by reducing code duplication and making the `execute` method more concise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⟳ maintenance A task to keep the code up-to-date and manageable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant