[open-ils-commits] r14442 - tags/rel_1_6_0_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 15 09:56:17 EDT 2009


Author: erickson
Date: 2009-10-15 09:56:16 -0400 (Thu, 15 Oct 2009)
New Revision: 14442

Modified:
   tags/rel_1_6_0_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
use inline penalty processing during fine generation to prevent duplicate penalties

Modified: tags/rel_1_6_0_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- tags/rel_1_6_0_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-10-15 13:55:49 UTC (rev 14441)
+++ tags/rel_1_6_0_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-10-15 13:56:16 UTC (rev 14442)
@@ -768,13 +768,19 @@
 
 			$self->method_lookup('open-ils.storage.transaction.commit')->run;
 
-            if(0) { # caluclate penalties inline.  Needs to be tested.
-                OpenILS::Utils::Penalty->calculate_penalties(
-                    undef, $c->usr->to_fieldmapper->id.'', $c->circ_lib->to_fieldmapper->id.'');
+			if(1) { 
 
-            } else {
+                # Caluclate penalties inline
+				OpenILS::Utils::Penalty->calculate_penalties(
+					undef, $c->usr->to_fieldmapper->id.'', $c->circ_lib->to_fieldmapper->id.'');
 
-			    $penalty->request(
+			} else {
+
+                # Calculate penalties with an aysnc call to the penalty server.  This approach
+                # may lead to duplicate penalties since multiple penalty processes for a
+                # given user may be running at the same time. Leave this here for reference 
+                # in case we later find that asyc calls are needed in some environments.
+				$penalty->request(
 				    'open-ils.penalty.patron_penalty.calculate',
 				    { patronid	=> ''.$c->usr,
 				    context_org	=> ''.$c->circ_lib,



More information about the open-ils-commits mailing list