cc-2683: not using utc time

-clean up recorder file
This commit is contained in:
martin 2011-08-16 16:36:31 -04:00
parent 0a11160298
commit e392c8437a
2 changed files with 5 additions and 8 deletions

View File

@ -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'));

View File

@ -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