CC-5898: Future repeating shows may not get generated and/or filled with content
Refactored show creation into separate function
This commit is contained in:
parent
ead4a3c565
commit
22218079af
|
@ -974,13 +974,7 @@ SQL;
|
|||
$needScheduleUntil = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$needScheduleUntil->add(new DateInterval("P1D"));
|
||||
}
|
||||
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
|
||||
//if application is requesting shows past our previous populated until date, generate shows up until this point.
|
||||
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $needScheduleUntil->getTimestamp()) {
|
||||
$service_show = new Application_Service_ShowService();
|
||||
$ccShow = $service_show->delegateInstanceCreation(null, $needScheduleUntil, true);
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($needScheduleUntil);
|
||||
}
|
||||
Application_Model_Show::createAndFillShowInstancesPastPopulatedUntilDate($needScheduleUntil);
|
||||
|
||||
list($range_start, $range_end) = self::getRangeStartAndEnd($p_fromDateTime, $p_toDateTime);
|
||||
|
||||
|
|
|
@ -831,6 +831,18 @@ SQL;
|
|||
|
||||
}
|
||||
|
||||
public static function createAndFillShowInstancesPastPopulatedUntilDate($needScheduleUntil)
|
||||
{
|
||||
//UTC DateTime object
|
||||
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
|
||||
//if application is requesting shows past our previous populated until date, generate shows up until this point.
|
||||
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $needScheduleUntil->getTimestamp()) {
|
||||
$service_show = new Application_Service_ShowService();
|
||||
$ccShow = $service_show->delegateInstanceCreation(null, $needScheduleUntil, true);
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($needScheduleUntil);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the show instances in the given time range (inclusive).
|
||||
*
|
||||
|
@ -844,14 +856,7 @@ SQL;
|
|||
*/
|
||||
public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE)
|
||||
{
|
||||
//UTC DateTime object
|
||||
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
|
||||
//if application is requesting shows past our previous populated until date, generate shows up until this point.
|
||||
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) {
|
||||
$service_show = new Application_Service_ShowService();
|
||||
$ccShow = $service_show->delegateInstanceCreation(null, $end_timestamp, true);
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp);
|
||||
}
|
||||
self::createAndFillShowInstancesPastPopulatedUntilDate($end_timestamp);
|
||||
|
||||
$sql = <<<SQL
|
||||
SELECT si1.starts AS starts,
|
||||
|
|
Loading…
Reference in New Issue