Tpac: clear the per-process cache of org-unit settings on each page load user/senator/tpac-clear-aous-cache
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 27 Oct 2011 21:37:06 +0000 (17:37 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 27 Oct 2011 21:37:06 +0000 (17:37 -0400)
Any time saved is not worth the confusion of changes to org unit settings not
taking effect in the TPAC without an apache restart, or worse, taking
effect for some page loads but not others.

Actually authored by Bill.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm

index 3b72dbc..af027e3 100644 (file)
@@ -21,6 +21,10 @@ sub init_ro_object_cache {
     my $e = $self->editor;
     my $ctx = $self->ctx;
 
+    # reset org unit setting cache on each page load to avoid the 
+    # requirement of reloading apache with each org-setting change
+    $cache{org_settings} = {};
+
     if($ro_object_subs) {
         # subs have been built.  insert into the context then move along.
         $ctx->{$_} = $ro_object_subs->{$_} for keys %$ro_object_subs;