parent
0a11160298
commit
e392c8437a
|
@ -108,13 +108,12 @@ class RabbitMq
|
|||
$EXCHANGE = 'airtime-show-recorder';
|
||||
$channel->exchange_declare($EXCHANGE, 'direct', false, true);
|
||||
|
||||
$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");
|
||||
$now = new DateTime("@".time());
|
||||
$end_timestamp = new DateTime("@".time() + 3600*2);
|
||||
|
||||
$temp['event_type'] = $event_type;
|
||||
if($event_type = "update_schedule"){
|
||||
$temp['shows'] = Show::getShows($today_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=TRUE);
|
||||
$temp['shows'] = Show::getShows($now->format("Y-m-d H:i:s"), $end_timestamp->format("Y-m-d H:i:s"), $excludeInstance=NULL, $onlyRecord=TRUE);
|
||||
}
|
||||
$data = json_encode($temp);
|
||||
$msg = new AMQPMessage($data, array('content_type' => 'text/plain'));
|
||||
|
|
|
@ -168,7 +168,7 @@ class CommandListener(Thread):
|
|||
self.logger = logging.getLogger('root')
|
||||
self.sr = None
|
||||
self.current_schedule = {}
|
||||
self.shows_to_record = []
|
||||
self.shows_to_record = {}
|
||||
self.time_till_next_show = 3600
|
||||
self.logger.info("RecorderFetch: init complete")
|
||||
|
||||
|
@ -208,8 +208,6 @@ class CommandListener(Thread):
|
|||
self.logger.info("Parsing show schedules...")
|
||||
self.shows_to_record = {}
|
||||
for show in shows:
|
||||
print show
|
||||
|
||||
show_starts = getDateTimeObj(show[u'starts'])
|
||||
show_end = getDateTimeObj(show[u'ends'])
|
||||
time_delta = show_end - show_starts
|
||||
|
|
Loading…
Reference in New Issue