CC-2588 :Use RabbitMQ to control the show recorder
- done
This commit is contained in:
parent
047a288c38
commit
2b36e8193e
4 changed files with 150 additions and 210 deletions
|
@ -80,7 +80,16 @@ class RabbitMq
|
|||
$EXCHANGE = 'airtime-show-recorder';
|
||||
$channel->exchange_declare($EXCHANGE, 'direct', false, true);
|
||||
|
||||
$msg = new AMQPMessage($event_type, array('content_type' => 'text/plain'));
|
||||
$today_timestamp = date("Y-m-d H:i:s");
|
||||
$now = new DateTime($today_timestamp);
|
||||
$end_timestamp = $now->add(new DateInterval("PT2H"));
|
||||
$end_timestamp = $end_timestamp->format("Y-m-d H:i:s");
|
||||
$temp['event_type'] = $event_type;
|
||||
if($event_type = "update_schedule"){
|
||||
$temp['shows'] = Show::getShows($today_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=TRUE);
|
||||
}
|
||||
$data = json_encode($temp);
|
||||
$msg = new AMQPMessage($data, array('content_type' => 'text/plain'));
|
||||
|
||||
$channel->basic_publish($msg, $EXCHANGE);
|
||||
$channel->close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue