Locate the path.
| 137 | |
| 138 | // Locate the path. |
| 139 | foreach (const Owned<PathInfo>& info, paths.get(timeout)) { |
| 140 | if (info->path == path) { |
| 141 | // If the path is currently undergoing removal, we cannot |
| 142 | // prevent path removal and wait for removal completion. |
| 143 | if (info->removing) { |
| 144 | // Return false to be consistent with the behavior when |
| 145 | // `unschedule` is called after the path is removed. |
| 146 | return info->promise.future() |
| 147 | .then([]() { return false; }); |
| 148 | } |
| 149 | |
| 150 | // Discard the promise. |
| 151 | info->promise.discard(); |
| 152 | |
| 153 | // Clean up the maps. |
| 154 | CHECK(paths.remove(timeout, info)); |
| 155 | CHECK_EQ(timeouts.erase(info->path), 1u); |
| 156 | |
| 157 | return true; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | LOG(FATAL) << "Inconsistent state across 'paths' and 'timeouts'"; |
| 162 | return false; |
nothing calls this directly
no test coverage detected