|
|
@ -444,12 +444,14 @@ static void manageJobStartedEvent(color_ostream& out) {
|
|
|
|
|
|
|
|
|
|
|
|
// iterate event handler callbacks
|
|
|
|
// iterate event handler callbacks
|
|
|
|
multimap<Plugin*, EventHandler> copy(handlers[EventType::JOB_STARTED].begin(), handlers[EventType::JOB_STARTED].end());
|
|
|
|
multimap<Plugin*, EventHandler> copy(handlers[EventType::JOB_STARTED].begin(), handlers[EventType::JOB_STARTED].end());
|
|
|
|
for (auto &key_value : copy) {
|
|
|
|
for (df::job_list_link* link = df::global::world->jobs.list.next; link != nullptr; link = link->next) {
|
|
|
|
auto &handler = key_value.second;
|
|
|
|
df::job* job = link->item;
|
|
|
|
for (df::job_list_link* link = df::global::world->jobs.list.next; link != nullptr; link = link->next) {
|
|
|
|
bool send = false;
|
|
|
|
df::job* job = link->item;
|
|
|
|
for (auto &key_value : copy) {
|
|
|
|
|
|
|
|
auto &handler = key_value.second;
|
|
|
|
// the jobs must have a worker to start
|
|
|
|
// the jobs must have a worker to start
|
|
|
|
if (job && Job::getWorker(job) && !startedJobs.count(job->id)) {
|
|
|
|
if (send || (job && Job::getWorker(job) && !startedJobs.count(job->id))) {
|
|
|
|
|
|
|
|
send = true;
|
|
|
|
startedJobs.emplace(job->id);
|
|
|
|
startedJobs.emplace(job->id);
|
|
|
|
handler.eventHandler(out, job);
|
|
|
|
handler.eventHandler(out, job);
|
|
|
|
}
|
|
|
|
}
|
|
|
|