0

I am using PHP to implement scheduler. My requirement is to run a queue between 9:00AM till 9:00PM. Added jobs in queue beside that time period should not process.

Below is my code:

<?php
include('autoload.php');
include('ResqueScheduler.php');
include('Resque.php');


Resque::setBackend('XXXXXXXXXXXXXXXXXXX');

$args = array('glid' => '1234');
$time = 10;

try{
  ResqueScheduler::enqueueAt($time, 'Test_Worker', $args);


}catch (Exception $e) {
  echo 'EXCEPTION';
  print_r($e);
}
Sjon
  • 4,989
  • 6
  • 28
  • 46
  • Please specify a question. I see your code, I don't see a problem :) – Sjon Jul 21 '16 at 06:48
  • you don't essentially need a scheduler to do that, you can check the current time and decide whether to perform the job or not .. if you want to persist the jobs and only perform them when during 9 AM and 9 PM, you can use something like Cron, to stop and start the workers as appropriate . – Vamsi Krishna B Jul 21 '16 at 07:02
  • Hi Sjon, i am unable to see this job on Rescue Overview listing.means how to check if a job is scheduled and processing.please help me out – Neha Sachan Sep 06 '16 at 06:08
  • Hi vamsi,i need resque to do that job, cron is very old idea to start and stop. – Neha Sachan Sep 06 '16 at 06:09

0 Answers0