Author: sevein
Date: Fri Dec 30 17:52:12 2011
New Revision: 10494

Log:
Stop using exit() under the fork block, it makes the job unfinished forever

Modified:
   trunk/plugins/qtSwordPlugin/lib/qtSwordPluginWorker.class.php

Modified: trunk/plugins/qtSwordPlugin/lib/qtSwordPluginWorker.class.php
==============================================================================
--- trunk/plugins/qtSwordPlugin/lib/qtSwordPluginWorker.class.php       Fri Dec 
30 17:48:47 2011        (r10493)
+++ trunk/plugins/qtSwordPlugin/lib/qtSwordPluginWorker.class.php       Fri Dec 
30 17:52:12 2011        (r10494)
@@ -87,19 +87,26 @@
       {
         $resource = 
QubitInformationObject::getById($package['information_object_id']);
 
+        echo sprintf("[%s] Object slug: %s\n", $pid, $resource->slug);
+
         $extractor = qtPackageExtractorFactory::build($package['format'],
           $package + array('resource' => $resource, 'job' => $job));
 
         $extractor->run();
+
+        # Simulating a exception for testing fork behavior
+        # throw new Exception('Foobar');
       }
       catch (Exception $e)
       {
         echo sprintf("[%s] Exception: %s\n", $pid, $e);
-        exit(1);
       }
 
-      echo sprintf("[%s] Job finished successfully\n", $pid);
-      exit(0);
-    }
+      echo sprintf("[%s] Fork finished\n", $pid);
+    } // Fork ends
+
+    echo sprintf("Job finished\n");
+
+    return true;
   }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to