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

Remove content type lookup when clearing cached values #13544

Closed
abhi1693 opened this issue Aug 24, 2023 · 1 comment · Fixed by #13545
Closed

Remove content type lookup when clearing cached values #13544

abhi1693 opened this issue Aug 24, 2023 · 1 comment · Fixed by #13545
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@abhi1693
Copy link
Member

Proposed Changes

index 9a29c54f5..e072c220a 100644
--- a/netbox/extras/management/commands/reindex.py
+++ b/netbox/extras/management/commands/reindex.py
@@ -69,10 +69,7 @@ class Command(BaseCommand):
         if not kwargs['lazy']:
             self.stdout.write('Clearing cached values... ', ending='')
             self.stdout.flush()
-            content_types = [
-                ContentType.objects.get_for_model(model) for model in indexers.keys()
-            ]
-            deleted_count = search_backend.clear(content_types)
+            deleted_count = search_backend.clear()
             self.stdout.write(f'{deleted_count} entries deleted.')

Justification

When trying to debug the issue for #13507, I wanted to clear my existing cache so I ran ./manage.py reindex expecting all values to be removed including any plugins that have been uninstalled. However, that was not the case and my search was still broken as the plugin values still existed within CacheValue

@abhi1693 abhi1693 added the type: housekeeping Changes to the application which do not directly impact the end user label Aug 24, 2023
@jeremystretch
Copy link
Member

I'm going to classify this as a bug since we're altering the command's (undesired) behavior.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed type: housekeeping Changes to the application which do not directly impact the end user labels Aug 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants