reviewboard.search.signal_processor¶
The signal processor for Review Board search.
- class SignalProcessor(*args, **kwargs)¶
Bases:
BaseSignalProcessor
“Listens for signals and updates the search index.
This will listen for any signals that would affect the search index, and invokes a suitable Haystack callback to immediately update the data stored in the index.
This only updates the search index if:
Search is enabled.
The current search engine backend supports on-the-fly indexing.
- save_signals = [(<class 'reviewboard.reviews.models.review_request.ReviewRequest'>, <django.dispatch.dispatcher.Signal object>, 'review_request'), (<class 'django.contrib.auth.models.User'>, <django.db.models.signals.ModelSignal object>, 'instance'), (<class 'reviewboard.accounts.models.Profile'>, <django.db.models.signals.ModelSignal object>, 'instance')]¶
- delete_signals = [(<class 'reviewboard.reviews.models.review_request.ReviewRequest'>, <django.db.models.signals.ModelSignal object>), (<class 'django.contrib.auth.models.User'>, <django.db.models.signals.ModelSignal object>)]¶
- __init__(*args, **kwargs)¶
Initialize the signal processor.
- property can_process_signals¶
Whether the signal processor can currently process signals.
- setup()¶
Register the signal handlers for this processor.
- teardown()¶
Unregister all signal handlers for this processor.
- check_handle_save(instance_kwarg, **kwargs)¶
Conditionally update the search index when an object is updated.
- Parameters:
instance_kwarg (
unicode
) – The name of the instance parameter.**kwargs (
dict
) – Signal arguments. These will be passed tohandle_save()
.
- check_handle_delete(**kwargs)¶
Conditionally update the search index when an object is deleted.
- Parameters:
**kwargs (
dict
) – Signal arguments. These will be passed tohandle_delete()
.
- handle_save(**kwargs)¶
Update the search index when an object is updated.
If there’s any error writing to the search backend, the error will be caught and logged.
- Parameters:
**kwargs (
dict
) – Signal arguments. These will be passed tohandle_save()
.
- handle_delete(**kwargs)¶
Update the search index when an object is deleted.
If there’s any error writing to the search backend, the error will be caught and logged.
- Parameters:
**kwargs (
dict
) – Signal arguments. These will be passed tohandle_save()
.