Permalink
Browse files

Set up a worker_status.php webpage to tell the status of a worker.

  • Loading branch information...
1 parent 6de8be1 commit 9d1b352f4c56e77e5a109978afec27734a07b936 @paddyforan paddyforan committed Jan 11, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 worker_status.php
View
@@ -0,0 +1,21 @@
+<?php
+$headers = getallheaders();
+$is_ajax = array_key_exists("X-Requested-With", $headers) && $headers["X-Requested-With"] == "XMLHttpRequest";
+
+include("lib/IronWorker/IronWorker.class.php");
+
+$name = "TweetWorker.php";
+
+$worker = new IronWorker('worker/config.ini');
+$worker->debug_enabled = false;
+
+$task_id = $_GET['task_id'];
+
+$details = $worker->getTaskDetails($task_id);
+
+if($is_ajax) {
+ echo json_encode($details);
+} else {
+ print "Task is ".$details->status;
+}
+?>

0 comments on commit 9d1b352

Please sign in to comment.