feat: move dumping to separate thread
This commit is contained in:
+13
-10
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user