You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.
Describe the feature
Inside filewatcher.cpp we only handle modifying files:
// cppcheck-suppress passedByValuevoidFilewatcher::handleFileAction(efsw::WatchID watchid, std::string const& dir, std::string const& filename, efsw::Action action, std::string oldFilename)
{
TracySetThreadName("Filewatcher Thread");
TracyZoneScoped;
std::filesystem::path fullPath = dir + "/" + filename;
switch (action)
{
case efsw::Actions::Add:
break;
case efsw::Actions::Delete:
break;
case efsw::Actions::Modified:
modifiedQueue.enqueue(fullPath);
break;
case efsw::Actions::Moved:
break;
default:
break;
}
}
luautils.cpp:
voidReloadFilewatchList()
{
std::set<std::string> filenames; // For de-duping
std::filesystem::path path;
while (filewatcher->modifiedQueue.try_dequeue(path))
{
if (path.extension() == ".lua")
{
std::string filename = path.relative_path().generic_string();
filenames.insert(filename);
}
}
for (autoconst& filename : filenames)
{
ShowInfo("[FileWatcher] %s", filename);
CacheLuaObjectFromFile(filename, true);
}
}
This will also need "debouncing" of the filewatcher event. The OS might deliver signals of a file being modified after it was deleted, so it needs to catch that sort of thing safely.
I affirm:
Describe the feature
Inside
filewatcher.cpp
we only handle modifying files:luautils.cpp
:We need to do something like:
modifiedQueue.enqueue({ fullPath, actionType(MODIFY/DELETE/WHATEVER) });
and then handle it on the other end (on the main thread) and wipe things from the cache if the relevant file was deleted
The text was updated successfully, but these errors were encountered: