compatdb: Use a seperate endpoint for testcase submission
This commit is contained in:
parent
a9dc34ea5c
commit
585b6a6a50
7 changed files with 65 additions and 7 deletions
|
@ -102,16 +102,27 @@ void TelemetryJson::Complete() {
|
|||
impl->SerializeSection(Telemetry::FieldType::App, "App");
|
||||
impl->SerializeSection(Telemetry::FieldType::Session, "Session");
|
||||
impl->SerializeSection(Telemetry::FieldType::Performance, "Performance");
|
||||
impl->SerializeSection(Telemetry::FieldType::UserFeedback, "UserFeedback");
|
||||
impl->SerializeSection(Telemetry::FieldType::UserConfig, "UserConfig");
|
||||
impl->SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem");
|
||||
|
||||
auto content = impl->TopSection().dump();
|
||||
// Send the telemetry async but don't handle the errors since they were written to the log
|
||||
Common::DetachedTasks::AddTask(
|
||||
[host{impl->host}, username{impl->username}, token{impl->token}, content]() {
|
||||
Client{host, username, token}.PostJson("/telemetry", content, true);
|
||||
});
|
||||
Common::DetachedTasks::AddTask([host{impl->host}, content]() {
|
||||
Client{host, "", ""}.PostJson("/telemetry", content, true);
|
||||
});
|
||||
}
|
||||
|
||||
bool TelemetryJson::SubmitTestcase() {
|
||||
impl->SerializeSection(Telemetry::FieldType::App, "App");
|
||||
impl->SerializeSection(Telemetry::FieldType::Session, "Session");
|
||||
impl->SerializeSection(Telemetry::FieldType::UserFeedback, "UserFeedback");
|
||||
impl->SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem");
|
||||
|
||||
auto content = impl->TopSection().dump();
|
||||
Client client(impl->host, impl->username, impl->token);
|
||||
auto value = client.PostJson("/gamedb/testcase", content, false);
|
||||
|
||||
return value.result_code == Common::WebResult::Code::Success;
|
||||
}
|
||||
|
||||
} // namespace WebService
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
void Visit(const Telemetry::Field<std::chrono::microseconds>& field) override;
|
||||
|
||||
void Complete() override;
|
||||
bool SubmitTestcase() override;
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue