[Rt-commit] rt branch, 4.4/not-apply-scrip-batch-in-nested-atomic, updated. rt-4.4.4-80-g7e8152b748

? sunnavy sunnavy at bestpractical.com
Wed Dec 4 13:14:07 EST 2019


The branch, 4.4/not-apply-scrip-batch-in-nested-atomic has been updated
       via  7e8152b7486169f7af954881876015ef9a1c04b9 (commit)
      from  49294ae81e86ae23fa46b7c0f75a83cc30b71f2c (commit)

Summary of changes:
 lib/RT/Ticket.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 7e8152b7486169f7af954881876015ef9a1c04b9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 5 02:00:06 2019 +0800

    Don't call ApplyTransactionBatch in Atomic when in DryRun mode
    
    DryRun explicitly calls ApplyTransactionBatch at last, so it's not
    needed to call it in Atomic in advance. In some sense, DryRun is kinda
    like the most outer Atomic call.

diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 0156b4754b..d5e92be217 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -1787,7 +1787,7 @@ sub Atomic {
     }
 
     if ($RT::Handle->TransactionDepth == $depth) {
-        $self->ApplyTransactionBatch if $self->{Atomic} == 1;
+        $self->ApplyTransactionBatch if $self->{Atomic} == 1 && !$self->{DryRun};
         $RT::Handle->Commit;
         $self->{Atomic}--;
     }

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


More information about the rt-commit mailing list