[Rt-commit] rt branch, 4.2/cache-ocfvs-on-update, repushed

Jim Brandt jbrandt at bestpractical.com
Mon Sep 18 14:49:58 EDT 2017


The branch 4.2/cache-ocfvs-on-update was deleted and repushed:
       was e8b517a37d0e21d5c9ec45227f4078a54e2cc903
       now 97a3570b6cfdfa78eee027eb753ea237541b0cba

1:  e8b517a ! 1:  97a3570 Cache OCFVs to improve performance searching for duplicates on add
    @@ -8,6 +8,21 @@
         the HasEntry code pulled the full list of values from the DB for every
         check, creating a performance issue. Cache the values to speed up the
         existing value check.
    +
    +diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
    +--- a/lib/RT/CustomField.pm
    ++++ b/lib/RT/CustomField.pm
    +@@
    +         return ( 0, $self->loc('Input must match [_1]', $self->FriendlyPattern) );
    +     }
    + 
    ++    # Clear any cached values
    ++    my $ocfv_key = $oldval->GetOCFVCacheKey;
    ++    delete $RT::ObjectCustomFieldValues::_OCFV_CACHE->{$ocfv_key};
    ++
    +     # delete it
    + 
    +     my $ret = $oldval->Delete();
     
     diff --git a/lib/RT/ObjectCustomFieldValue.pm b/lib/RT/ObjectCustomFieldValue.pm
     --- a/lib/RT/ObjectCustomFieldValue.pm



More information about the rt-commit mailing list