return j;
}
+shared_ptr<Job>
+JobManager::add_after (shared_ptr<Job> after, shared_ptr<Job> j)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ list<shared_ptr<Job> >::iterator i = find (_jobs.begin(), _jobs.end(), after);
+ DCPOMATIC_ASSERT (i != _jobs.end());
+ _jobs.insert (i, j);
+ }
+
+ emit (boost::bind (boost::ref (JobAdded), weak_ptr<Job> (j)));
+
+ return j;
+}
+
list<shared_ptr<Job> >
JobManager::get () const
{
{
public:
boost::shared_ptr<Job> add (boost::shared_ptr<Job>);
+ boost::shared_ptr<Job> add_after (boost::shared_ptr<Job> after, boost::shared_ptr<Job> j);
std::list<boost::shared_ptr<Job> > get () const;
bool work_to_do () const;
bool errors () const;
string body = Config::instance()->notification_email();
boost::algorithm::replace_all (body, "$JOB_NAME", _job->name());
boost::algorithm::replace_all (body, "$JOB_STATUS", _job->status());
- JobManager::instance()->add (shared_ptr<Job> (new SendNotificationEmailJob (body)));
+ JobManager::instance()->add_after (_job, shared_ptr<Job> (new SendNotificationEmailJob (body)));
}
}
}