Add a signal for detecting reloaded SiteConfigurations.
Review Request #9481 — Created Jan. 13, 2018 and submitted
This introduces a
siteconfig_reloadedsignal, which consumers can
listen to in order to update their state when a
expired and has been reloaded. The signal contains the new instance,
along with the old instance for settings comparison purposes.
A couple of changes were made to enable use of this signal.
First, the behavior of
slightly changed. Previously, expiration just meant clearing the value
from cache, causing the next
get_current()to re-fetch. Now, if there
are any listeners for the signal, the new instance is fetched
immediately, so that it can be passed to the signal handler. This
shouldn't impact any consumers. If no listeners are present, the new
instance is not fetched.
A new method
get_for_site_id()method was also added for use in
check_expired(). This works like
get_current(), but takes the ID of
Site, handling caching.
The docs throughout the file have been modernized, helping to keep this
maintainable going forward.
All unit tests for Djblets and Review Board pass.
Added the missing
Revision 2 (+215 -90)
Checks run (2 succeeded)