[open-ils-commits] r14755 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 3 18:05:53 EST 2009
Author: erickson
Date: 2009-11-03 18:05:47 -0500 (Tue, 03 Nov 2009)
New Revision: 14755
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
Log:
make event firing more fault-tolerant to allow continued processing of very large data sets when one event or event group fails
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2009-11-03 22:59:14 UTC (rev 14754)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2009-11-03 23:05:47 UTC (rev 14755)
@@ -532,8 +532,18 @@
my %groups = ( '*' => [] );
for my $e_id ( @$events ) {
- my $e = OpenILS::Application::Trigger::Event->new($e_id);
- if ($e->validate->valid) {
+
+ my $e;
+ try {
+ $e = OpenILS::Application::Trigger::Event->new($e_id);
+ } otherwise {};
+
+ next unless $e;
+
+ if (try { $e->validate->valid } otherwise { $e = undef; }) {
+
+ next unless $e;
+
if (my $group = $e->event->event_def->group_field) {
# split the grouping link steps
@@ -575,20 +585,30 @@
for my $def ( %$groups ) {
if ($def eq '*') {
for my $event ( @{ $$groups{'*'} } ) {
- $client->respond(
- $self
- ->method_lookup('open-ils.trigger.event.fire')
- ->run($event)
- );
+ try {
+ $client->respond(
+ $self
+ ->method_lookup('open-ils.trigger.event.fire')
+ ->run($event)
+ );
+ } otherwise {
+ # un-oh
+ $logger->error("event firing failed");
+ };
}
} else {
my $defgroup = $$groups{$def};
for my $ident ( keys %$defgroup ) {
- $client->respond(
- $self
- ->method_lookup('open-ils.trigger.event_group.fire')
- ->run($$defgroup{$ident})
- );
+ try {
+ $client->respond(
+ $self
+ ->method_lookup('open-ils.trigger.event_group.fire')
+ ->run($$defgroup{$ident})
+ );
+ } otherwise {
+ # uh-oh
+ $logger->error("event group firing failed");
+ };
}
}
}
More information about the open-ils-commits
mailing list