обновил сбор статистики, теперь он выполняется отдельно от загрузки состояния и может работать на FULL RATE. К тому же, статистика доступна только на SCPC модеме

This commit is contained in:
2025-04-03 15:26:03 +03:00
parent a204c4002b
commit 70a2257255
3 changed files with 32 additions and 22 deletions

View File

@@ -480,7 +480,7 @@ public:
rep.headers.push_back({.name = "Content-Type", .value = toString(mime_types::json)});
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
}));
#ifdef MODEM_IS_SCPC
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/dev/settings", this->auth, http::auth::User::DEVELOPER, [this](const auto& req, auto& rep) {
std::string result;
if (req.method == "GET") {
@@ -519,6 +519,7 @@ public:
rep.content.clear();
http::resource::loadFile("/tmp/weblog-statistics.csv", rep.content);
}));
#endif
}
~ServerResources() = default;