move the early-out response so we avoid breaking the caller
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Sep 2010 20:45:17 +0000 (20:45 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Sep 2010 20:45:17 +0000 (20:45 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18091 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm

index cfa31f8..4a80255 100644 (file)
@@ -672,15 +672,6 @@ sub grouped_events {
 
         $e->editor->disconnect;
     }
-    # Could report on how the "found" events were grouped, but who's going to
-    # consume that information?
-    for my $key (keys %groups) {
-        if (@{ $groups{$key} }) {
-            $client->respond({"status" => "found"});
-            last;
-        }
-    }
-
 
     return \%groups;
 }
@@ -697,6 +688,15 @@ sub run_all_events {
 
     my ($groups) = $self->method_lookup('open-ils.trigger.event.find_pending_by_group')->run($granularity);
 
+    # Could report on how the "found" events were grouped, but who's going to
+    # consume that information?
+    for my $key (keys %$groups) {
+        if (@{ $$groups{$key} }) {
+            $client->respond({"status" => "found"});
+            last;
+        }
+    }
+
     for my $def ( keys %$groups ) {
         if ($def eq '*') {
             $logger->info("trigger: run_all_events firing un-grouped events");