feat: move dumping to separate thread

This commit is contained in:
2026-04-09 23:16:12 -03:00
parent 76d581c419
commit a1a123054f
+13 -10
View File
@@ -6,6 +6,7 @@
#include <random> #include <random>
#include <vector> #include <vector>
#include <regex> #include <regex>
#include <thread>
#include <time.h> #include <time.h>
@@ -102,16 +103,18 @@ bool Spoofer::parseCatalog(std::string data)
return false; return false;
} }
std::string outPath = utils::getExePath() + "catalog.json"; std::thread t([&data]() {
std::ofstream file(outPath); std::string outPath = utils::getExePath() + "catalog.json";
if (file.is_open()) std::ofstream file(outPath);
{ if (file.is_open())
file << data; {
file.close(); file << data;
Log::verbose("Raw catalog saved to {}", outPath); file.close();
} Log::verbose("Raw catalog saved to {}", outPath);
else }
Log::error("Unable to write to catalog.json"); else
Log::error("Unable to write to catalog.json");
});
try try
{ {