| 88 | } |
| 89 | |
| 90 | tmp_dir::~tmp_dir() |
| 91 | { |
| 92 | if(not enabled(MIGRAPHX_DEBUG_SAVE_TEMP_DIR{})) |
| 93 | { |
| 94 | constexpr int max_retries_count = 5; |
| 95 | for([[maybe_unused]] auto count : range(max_retries_count)) |
| 96 | { |
| 97 | std::error_code ec; |
| 98 | fs::remove_all(path, ec); |
| 99 | if(not ec) |
| 100 | break; |
| 101 | std::cerr << "Failed to remove " << path << ": " << ec.message() << std::endl; |
| 102 | std::this_thread::sleep_for(std::chrono::milliseconds(125)); |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | } // namespace MIGRAPHX_INLINE_NS |
| 108 | } // namespace migraphx |