mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: [STUDIO-1419] conflict when removing old logs by multi process
Change-Id: I6529fa649020a2d4419048e470e343bfd63c41bf
This commit is contained in:
parent
5e02f87980
commit
05904e3770
1 changed files with 5 additions and 2 deletions
|
@ -1159,8 +1159,11 @@ void GUI_App::post_init()
|
|||
std::vector<std::pair<time_t, std::string>> files_vec;
|
||||
for (auto& it : boost::filesystem::directory_iterator(log_folder)) {
|
||||
auto temp_path = it.path();
|
||||
try {
|
||||
std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ;
|
||||
files_vec.push_back({ lw_t, temp_path.filename().string() });
|
||||
} catch (const std::exception &ex) {
|
||||
}
|
||||
}
|
||||
std::sort(files_vec.begin(), files_vec.end(), [](
|
||||
std::pair<time_t, std::string> &a, std::pair<time_t, std::string> &b) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue