resque /
php-resque
| 1 | <?php |
||
| 2 | if(empty($argv[1])) { |
||
| 3 | die('Specify the ID of a job to monitor the status of.'); |
||
| 4 | } |
||
| 5 | |||
| 6 | require __DIR__ . '/init.php'; |
||
| 7 | |||
| 8 | date_default_timezone_set('GMT'); |
||
| 9 | Resque::setBackend('127.0.0.1:6379'); |
||
| 10 | // You can also use a DSN-style format: |
||
| 11 | //Resque::setBackend('redis://user:[email protected]:6379'); |
||
| 12 | //Resque::setBackend('redis://user:[email protected]:3432/2'); |
||
| 13 | |||
| 14 | $status = new Resque_Job_Status($argv[1]); |
||
| 15 | if(!$status->isTracking()) { |
||
| 16 | die("Resque is not tracking the status of this job.\n"); |
||
| 17 | } |
||
| 18 | |||
| 19 | echo "Tracking status of ".$argv[1].". Press [break] to stop.\n\n"; |
||
| 20 | while(true) { |
||
| 21 | fwrite(STDOUT, "Status of ".$argv[1]." is: ".$status->get()."\n"); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 22 | sleep(1); |
||
| 23 | } |