? tests
Index: job_queue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/job_queue/job_queue.module,v
retrieving revision 1.1.2.5
diff -u -u -r1.1.2.5 job_queue.module
--- job_queue.module	19 Oct 2007 22:55:06 -0000	1.1.2.5
+++ job_queue.module	10 Jan 2008 04:55:42 -0000
@@ -57,22 +57,22 @@
  */
 function job_queue_dequeue() {
   $result = db_query_range('SELECT jqid, description, function, arguments, file FROM {job_queue} ORDER BY jqid', 0, 1);
-  if (db_num_rows($result) > 0) {
-    $job = db_fetch_object($result);
-    if (!empty($job->file)) {
-      include_once $job->file;
-    }
-    if (function_exists($job->function)) {
-      call_user_func_array($job->function, unserialize($job->arguments));
-      watchdog('job_queue', t('Ran queued job "!description"', array('!description' => $job->description)));
-    }
-    else {
-      watchdog('job_queue', t('Failed to run queued job "!description" because the function %function is not defined.', array('!description' => $job->description, '%function' => $job->function)), WATCHDOG_ERROR);
-    }
-    db_query('DELETE FROM {job_queue} WHERE jqid = %d', $job->jqid);
-    return TRUE;
+  if (db_num_rows($result) ==  0) {
+    return FALSE;   
+  }
+  $job = db_fetch_object($result);
+  if (!empty($job->file)) {
+    include_once $job->file;
+  }
+  if (function_exists($job->function)) {
+    call_user_func_array($job->function, unserialize($job->arguments));
+    watchdog('job_queue', t('Ran queued job "!description"', array('!description' => $job->description)));
+  }
+  else {
+    watchdog('job_queue', t('Failed to run queued job "!description" because the function %function is not defined.', array('!description' => $job->description, '%function' => $job->function)), WATCHDOG_ERROR);
   }
-  return FALSE;
+  db_query('DELETE FROM {job_queue} WHERE jqid = %d', $job->jqid);
+  return TRUE;
 }
 
 function job_queue_cron() {
