| 237 | |
| 238 | |
| 239 | CheckerProcess::CheckerProcess( |
| 240 | const CheckInfo& checkInfo, |
| 241 | const string& launcherDir, |
| 242 | const lambda::function<void(const Try<CheckStatusInfo>&)>& _callback, |
| 243 | const TaskID& _taskId, |
| 244 | const string& _name, |
| 245 | Variant<runtime::Plain, runtime::Docker, runtime::Nested> _runtime, |
| 246 | const Option<string>& scheme, |
| 247 | bool ipv6) |
| 248 | : ProcessBase(process::ID::generate("checker")), |
| 249 | updateCallback(_callback), |
| 250 | taskId(_taskId), |
| 251 | name(_name), |
| 252 | runtime(std::move(_runtime)), |
| 253 | check(checkInfoToCheck(checkInfo, launcherDir, scheme, ipv6)), |
| 254 | paused(false) |
| 255 | { |
| 256 | Try<Duration> create = Duration::create(checkInfo.delay_seconds()); |
| 257 | CHECK_SOME(create); |
| 258 | checkDelay = create.get(); |
| 259 | |
| 260 | create = Duration::create(checkInfo.interval_seconds()); |
| 261 | CHECK_SOME(create); |
| 262 | checkInterval = create.get(); |
| 263 | |
| 264 | // Zero value means infinite timeout. |
| 265 | create = Duration::create(checkInfo.timeout_seconds()); |
| 266 | CHECK_SOME(create); |
| 267 | checkTimeout = |
| 268 | (create.get() > Duration::zero()) ? create.get() : Duration::max(); |
| 269 | } |
| 270 | |
| 271 | |
| 272 | void CheckerProcess::initialize() |
nothing calls this directly
no test coverage detected