Index: /branches/release-34/tools/run-periodic-tasks
===================================================================
--- /branches/release-34/tools/run-periodic-tasks (revision 1407)
+++ /branches/release-34/tools/run-periodic-tasks (revision 1870)
@@ -26,6 +26,4 @@
 my $sleep     = 5;
 my $help      = 0;
-# my $sync      = 0;
-# my $rsync_opt = '';
 my $load      = 10;
 my $verbose   = 0;
@@ -35,10 +33,4 @@
     "daemon"      => \$daemonize,
     "sleep=i"     => \$sleep,
-    # "help|?"      => \$help,
-    # "throttle=i"  => \%throttle,
-    # "worker=s"    => \$worker,
-    # "sync"        => \$sync,
-    # "to|target=s" => \@target,
-    # "rsync=s"     => \$rsync_opt,
     "load=i"      => \$load,
     "scoreboard=s"=> \$scoreboard,
@@ -51,15 +43,21 @@
 $cfg{prioritize} = 1;
 
-require MT::TheSchwartz;
-my $client = MT::TheSchwartz->new(%cfg);
-no warnings 'once';
-$TheSchwartz::FIND_JOB_BATCH_SIZE = $load;
+my $client = eval {
+    require MT::TheSchwartz;
+    my $c = MT::TheSchwartz->new(%cfg);
+    no warnings 'once';
+    $TheSchwartz::FIND_JOB_BATCH_SIZE = $load;
+    $c;
+};
+if ((my $error = $@) && $verbose) {
+    print STDERR "Error initializing TheSchwartz: $error\n";
+}
 
-if ($daemonize) {
+if ($daemonize && $client) {
     $client->work_periodically($sleep);
 } else {
     # First, run periodic tasks
     $mt->run_tasks();
-    $client->work_until_done;
+    $client->work_until_done if $client;
 }
 
