| 248 | |
| 249 | |
| 250 | Try<Nothing> unavailability(const Unavailability& unavailability) |
| 251 | { |
| 252 | const Duration duration = |
| 253 | Nanoseconds(unavailability.duration().nanoseconds()); |
| 254 | |
| 255 | // Check the bounds of the unavailability. |
| 256 | if (duration < Duration::zero()) { |
| 257 | return Error("Unavailability 'duration' is negative"); |
| 258 | } |
| 259 | |
| 260 | return Nothing(); |
| 261 | } |
| 262 | |
| 263 | |
| 264 | Try<Nothing> machines(const RepeatedPtrField<MachineID>& ids) |
no test coverage detected