From: erickson Date: Thu, 15 Oct 2009 13:55:20 +0000 (+0000) Subject: use inline penalty processing during fine generation to prevent duplicate penalties X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e8f260e20b862f6a7aba99ff7eff80cc9223d436;p=working%2FEvergreen.git use inline penalty processing during fine generation to prevent duplicate penalties git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@14440 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 9ca50b52e3..8106dd97c7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -768,13 +768,19 @@ sub generate_fines { $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,