18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 22:44:59 +01:00

fix(files): a folder changed in the future isn't read again on every name missing from it

This commit is contained in:
maj00r
2026-11-13 15:49:41 +01:00
parent afbc84c6bc
commit a30b5f30e1

View File

@@ -559,7 +559,9 @@ std::string cased_name(std::string const &Folder, std::string const &Name)
if ((false == cached.read) || (cached.changed != changed))
read();
auto found{cached.names.find(wanted)};
if ((found == cached.names.end()) && (cached.listed - cached.changed < std::chrono::seconds{2}))
// a folder changed in the future, as from another clock, isn't read again on every miss
auto const age{cached.listed - cached.changed};
if ((found == cached.names.end()) && (age >= std::chrono::seconds{0}) && (age < std::chrono::seconds{2}))
{
read();
found = cached.names.find(wanted);