| 113 | |
| 114 | namespace { |
| 115 | void flushWrDiskCacheEntry(WrDiskCache* wrDiskCache, |
| 116 | const std::shared_ptr<Segment>& segment) |
| 117 | { |
| 118 | const std::shared_ptr<Piece>& piece = segment->getPiece(); |
| 119 | if (piece->getWrDiskCacheEntry()) { |
| 120 | piece->flushWrCache(wrDiskCache); |
| 121 | if (piece->getWrDiskCacheEntry()->getError() != |
| 122 | WrDiskCacheEntry::CACHE_ERR_SUCCESS) { |
| 123 | segment->clear(wrDiskCache); |
| 124 | throw DOWNLOAD_FAILURE_EXCEPTION2( |
| 125 | fmt("Write disk cache flush failure index=%lu", |
| 126 | static_cast<unsigned long>(piece->getIndex())), |
| 127 | piece->getWrDiskCacheEntry()->getErrorCode()); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | } // namespace |
| 132 | |
| 133 | bool DownloadCommand::executeInternal() |
no test coverage detected