Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent full indexing (index_all) from being called multiple times #2864

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Nov 17, 2024

During the RubyConf 2024 hackday, while exploring some indexing behaviour using irb, there was some confusion because the index was referring to code that had been deleted.

In this PR, I've added a check that raises on attempting to called index_all if it already contains entries.

We could use a more technical approach such as adding a reindex method, or clearing the index each time when calling index_all. But since this is a relative rare usage, I think this protection is enough for the time being.

@andyw8 andyw8 added the server This pull request should be included in the server gem's release notes label Nov 17, 2024
@andyw8 andyw8 requested a review from a team as a code owner November 17, 2024 03:45
@andyw8 andyw8 added the enhancement New feature or request label Nov 17, 2024
@andyw8 andyw8 changed the title Prevent index_all being called multiple times Prevent full indexing (index_all) from being called multiple times Nov 17, 2024
lib/ruby_indexer/lib/ruby_indexer/index.rb Outdated Show resolved Hide resolved
lib/ruby_indexer/lib/ruby_indexer/index.rb Outdated Show resolved Hide resolved
@andyw8 andyw8 force-pushed the andyw8/prevent-index-all-being-called-multiple-times branch from a6f3fec to be72efe Compare November 18, 2024 15:45
@andyw8 andyw8 enabled auto-merge (squash) November 18, 2024 15:57
@andyw8 andyw8 merged commit 150f834 into main Nov 18, 2024
37 checks passed
@andyw8 andyw8 deleted the andyw8/prevent-index-all-being-called-multiple-times branch November 18, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants