Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r17374: making worker restart faster

Committer: gariev
making worker restart faster
U   trunk/bin/worker/search-updater
Modified: trunk/bin/worker/search-updater
===================================================================
--- trunk/bin/worker/search-updater	2010-09-14 11:31:00 UTC (rev 17373)
+++ trunk/bin/worker/search-updater	2010-09-14 18:27:54 UTC (rev 17374)
@@ -42,6 +42,7 @@
     return 0 unless $lock;
 
     my $dbr = LJ::get_db_reader() or die "No db";
+    $dbr->{'RaiseError'} = 1;
 
     unless ($fh) {
         # Open the filehandle if we haven't done so already.
@@ -59,9 +60,11 @@
     do {
         $count = LJ::UserSearch::MetaUpdater::update_file_partial($dbr, $fh, $loop_limit);
         $updates_since_last_restart += $count;
-    } while ($count == $loop_limit);
+    } while ($count == $loop_limit && !$class->should_quit);
 
-    restart_workers();
+    unless ($class->should_quit) {
+        restart_workers();
+    }
 
     return $count;
 }

Tags: gariev, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments