Codemerge.

        Patch by denise. 

diffs (51 lines):

diff -r 3f72ba1db1b5 -r 0bf8e6022067 cgi-bin/LJ/Worker/Gearman.pm
--- a/cgi-bin/LJ/Worker/Gearman.pm      Sun Jul 05 10:17:26 2009 +0000
+++ b/cgi-bin/LJ/Worker/Gearman.pm      Sun Jul 05 10:23:02 2009 +0000
@@ -140,26 +140,29 @@ sub gearman_work {
     };
 
     while (1) {
-          $periodic_checks->();
-          warn "waiting for work...\n" if $opt_verbose;
+        $periodic_checks->();
+        warn "waiting for work...\n" if $opt_verbose;
 
-          # do the actual work
-          $worker->work(
-                        stop_if     => sub { $_[0] },
-                        on_complete => $complete_cb,
-                        on_fail     => $fail_cb,
-                        on_start    => $start_cb,
-                        );
+        # do the actual work
+        eval {
+            $worker->work(
+                stop_if     => sub { $_[0] },
+                on_complete => $complete_cb,
+                on_fail     => $fail_cb,
+                on_start    => $start_cb,
+            );
+        };
+        warn $@ if $@;
 
-          if ($idle_handler) {
-              eval { 
-                  LJ::start_request();
-                  $idle_handler->();
-                  LJ::end_request();
-              };
-              warn $@ if $@;
-          }
-      }
+        if ($idle_handler) {
+            eval { 
+                LJ::start_request();
+                $idle_handler->();
+                LJ::end_request();
+            };
+            warn $@ if $@;
+        }
+    }
 }
 
 # --------------
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to