improved planner
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "CompilationSupervisor.h"
|
||||
#include "RunTask.h"
|
||||
|
||||
class RunSupervisor : public Supervisor<RunTask> {
|
||||
public:
|
||||
RunSupervisor(CompilationSupervisor* compilationSupervisor) {
|
||||
this->init("runTasks", 8);
|
||||
//проверить отмененные задачи.
|
||||
for (long i = 0; i < getLength(); ++i) {
|
||||
RunTask* task = this->get(i);
|
||||
CompilationTask* parent = compilationSupervisor->getTaskById(task->getTestCompilationTaskId());
|
||||
task->setState((parent->getState() == Done) ? Waiting : Canceled);
|
||||
task->setParent(parent);
|
||||
printf("id=%ld; parent_id = %ld; state=%s\n",
|
||||
task->getId(),
|
||||
task->getParent()->getId(),
|
||||
task->printState().getCharArray());
|
||||
}
|
||||
}
|
||||
|
||||
String getStatePrefix() override {
|
||||
return String("Running");
|
||||
}
|
||||
};
|
||||
#pragma once
|
||||
|
||||
#include "CompilationSupervisor.h"
|
||||
#include "RunTask.h"
|
||||
|
||||
class RunSupervisor : public Supervisor<RunTask> {
|
||||
public:
|
||||
RunSupervisor(CompilationSupervisor* compilationSupervisor) {
|
||||
this->init("runTasks", 8);
|
||||
//проверить отмененные задачи.
|
||||
for (long i = 0; i < getLength(); ++i) {
|
||||
RunTask* task = this->get(i);
|
||||
CompilationTask* parent = compilationSupervisor->getTaskById(task->getTestCompilationTaskId());
|
||||
task->setState((parent->getState() == Done) ? Waiting : Canceled);
|
||||
task->setParent(parent);
|
||||
#if DEB
|
||||
printf("id=%ld; parent_id = %ld; state=%s\n", task->getId(), task->getParent()->getId(), task->printState().getCharArray());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
String getStatePrefix() override {
|
||||
return String("Running");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user