[Rt-commit] rt branch, 4.2/clear-ocfv-cache-on-exit, created. rt-4.2.14-34-g3f98b5bd1

? sunnavy sunnavy at bestpractical.com
Fri Mar 16 17:04:38 EDT 2018


The branch, 4.2/clear-ocfv-cache-on-exit has been created
        at  3f98b5bd1df7498c840b81f2f3878185b1e8b579 (commit)

- Log -----------------------------------------------------------------
commit 3f98b5bd1df7498c840b81f2f3878185b1e8b579
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Mar 16 03:36:02 2018 +0800

    Run ClearOCFVCache on exit.
    
    Entries in OCFVCache contain RT::CustomField objects, which have related
    RT::Ticket objects as ContextObject. To safely run
    RT::Ticket::ApplyTransactionBatch before global destruction, we need to
    remove RT::Ticket objects from global cache variable.

diff --git a/lib/RT/ObjectCustomFieldValues.pm b/lib/RT/ObjectCustomFieldValues.pm
index ac3df168f..e5db0534b 100644
--- a/lib/RT/ObjectCustomFieldValues.pm
+++ b/lib/RT/ObjectCustomFieldValues.pm
@@ -233,4 +233,10 @@ sub _DoCount {
 
 RT::Base->_ImportOverlays();
 
+# Without this, there could be warnings generated like "Too late to safely run
+# transaction-batch scrips...", you can test it by commentting it out and run
+# some cf tests, e.g. perl -Ilib t/customfields/enter_one.t
+END { ClearOCFVCache(); }
+
+
 1;

-----------------------------------------------------------------------


More information about the rt-commit mailing list