the EventScheduler (and thus PlaylistEvents) recieved a null sessionId,

making them fail on scheduled execution. fix for issues #809 and #831
see http://bugs.campware.org/view.php?id=809
and http://bugs.campware.org/view.php?id=831
This commit is contained in:
maroy 2005-04-20 07:18:03 +00:00
parent 9848eefbe7
commit 84cd995e69

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.26 $
Version : $Revision: 1.27 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $
------------------------------------------------------------------------------*/
@ -266,20 +266,6 @@ SchedulerDaemon :: configure(const xmlpp::Element & element)
audioPlayer = apf->getAudioPlayer();
playLog = plf->getPlayLog();
schedule = sf->getSchedule();
Ptr<PlaylistEventContainer>::Ref eventContainer;
Ptr<time_duration>::Ref granularity;
eventContainer.reset(new PlaylistEventContainer(sessionId,
storage,
schedule,
audioPlayer,
playLog));
// TODO: read granularity from config file
granularity.reset(new time_duration(seconds(1)));
eventScheduler.reset(
new LiveSupport::EventScheduler::EventScheduler(eventContainer,
granularity));
}
@ -402,7 +388,23 @@ SchedulerDaemon :: startup (void) throw ()
// TODO: mark error
std::cerr << "Helix initialization problem: " << e.what() << std::endl;
}
if (!eventScheduler.get()) {
Ptr<PlaylistEventContainer>::Ref eventContainer;
Ptr<time_duration>::Ref granularity;
eventContainer.reset(new PlaylistEventContainer(sessionId,
storage,
schedule,
audioPlayer,
playLog));
// TODO: read granularity from config file
granularity.reset(new time_duration(seconds(1)));
eventScheduler.reset(
new LiveSupport::EventScheduler::EventScheduler(eventContainer,
granularity));
}
eventScheduler->start();
XmlRpcDaemon::startup();
}
@ -413,7 +415,9 @@ SchedulerDaemon :: startup (void) throw ()
void
SchedulerDaemon :: shutdown(void) throw (std::logic_error)
{
if (eventScheduler.get()) {
eventScheduler->stop();
}
audioPlayer->deInitialize();
XmlRpcDaemon::shutdown();
@ -427,6 +431,8 @@ void
SchedulerDaemon :: update (void) throw (std::logic_error)
{
// TODO: check if we've been configured
if (eventScheduler.get()) {
eventScheduler->update();
}
}