| 109 | |
| 110 | |
| 111 | Checker::Checker( |
| 112 | const CheckInfo& _check, |
| 113 | const string& _launcherDir, |
| 114 | const lambda::function<void(const CheckStatusInfo&)>& _callback, |
| 115 | const TaskID& _taskId, |
| 116 | Variant<runtime::Plain, runtime::Docker, runtime::Nested> _runtime) |
| 117 | : check(_check), |
| 118 | callback(_callback), |
| 119 | taskId(_taskId), |
| 120 | name(CheckInfo::Type_Name(check.type()) + " check"), |
| 121 | previousCheckStatus(createEmptyCheckStatusInfo(_check)) |
| 122 | { |
| 123 | VLOG(1) << "Check configuration for task '" << taskId << "':" |
| 124 | << " '" << jsonify(JSON::Protobuf(check)) << "'"; |
| 125 | |
| 126 | process.reset( |
| 127 | new CheckerProcess( |
| 128 | _check, |
| 129 | _launcherDir, |
| 130 | std::bind(&Checker::processCheckResult, this, lambda::_1), |
| 131 | _taskId, |
| 132 | name, |
| 133 | std::move(_runtime), |
| 134 | None(), |
| 135 | false)); |
| 136 | |
| 137 | spawn(process.get()); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | Checker::~Checker() |