From 79619659c74521fe0f0c2c82eadb32d2e3742c62 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 15 Oct 2009 13:52:57 +0000 Subject: [PATCH] use inline penalty processing during fine generation to prevent duplicate penalties git-svn-id: svn://svn.open-ils.org/ILS/trunk@14439 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Storage/Publisher/action.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 b95a52806b..4dfb654ff5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -768,11 +768,18 @@ sub generate_fines { $self->method_lookup('open-ils.storage.transaction.commit')->run; - if(0) { # caluclate penalties inline. Needs to be tested. + if(1) { + + # Caluclate penalties inline OpenILS::Utils::Penalty->calculate_penalties( undef, $c->usr->to_fieldmapper->id.'', $c->circ_lib->to_fieldmapper->id.''); + } 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, -- 2.11.0