mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2012-01-17 08:23 am

[dw-free] Schedule imports faster, log less

[commit: http://hg.dwscoalition.org/dw-free/rev/5aa38d807317]

Schedule imports faster, log less

Patch by [staff profile] mark.

Files modified:
  • bin/worker/import-scheduler
--------------------------------------------------------------------------------
diff -r b8a9b2c3c047 -r 5aa38d807317 bin/worker/import-scheduler
--- a/bin/worker/import-scheduler	Tue Jan 17 08:24:55 2012 +0000
+++ b/bin/worker/import-scheduler	Tue Jan 17 08:29:51 2012 +0000
@@ -155,26 +155,12 @@
 }
 
 # run the job in a loop
-my $begin_time = [ gettimeofday() ];
 while ( 1 ) {
     my $once = 0;
     GetOptions( 'verbose' => \$DEBUG, 'once' => \$once );
 
-    _log( 'Main loop beginning...' );
-
     worker_helper();
     last if $once;
 
-    # now we sleep to the next one minute boundary, and if we're taking more
-    # than one minute to run, we fire off an alert
-    my $sleep_time = 60 - tv_interval( $begin_time );
-    if ( $sleep_time < 0 ) {
-        _log( 'Warning: main loop is taking longer than a minute.' );
-        $sleep_time = 60;
-    }
-    _log( 'Sleeping for %0.2f seconds.', $sleep_time );
-    select undef, undef, undef, $sleep_time;
-
-    _log( 'Main loop ended.' );
-    $begin_time = [ gettimeofday() ];
+    sleep 1;
 }
--------------------------------------------------------------------------------