summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhupengfei <zhupf321@gmail.com>2019-04-19 16:02:49 +0200
committerfearlessTobi <thm.frey@gmail.com>2019-05-04 19:45:48 +0200
commit10c4f23953c12cf55afb8d7fe16c1675aa73c694 (patch)
tree47449be655f9c5d494648d9eb7c0420cb58e1995
parentloader/nso: Remove left-in debug pragma (diff)
downloadyuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar.gz
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar.bz2
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar.lz
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar.xz
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.tar.zst
yuzu-10c4f23953c12cf55afb8d7fe16c1675aa73c694.zip
-rw-r--r--src/core/telemetry_session.cpp17
-rw-r--r--src/core/telemetry_session.h1
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index e1db06811..4b17bada5 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -102,12 +102,6 @@ bool VerifyLogin(const std::string& username, const std::string& token) {
}
TelemetrySession::TelemetrySession() {
-#ifdef ENABLE_WEB_SERVICE
- backend = std::make_unique<WebService::TelemetryJson>(
- Settings::values.web_api_url, Settings::values.yuzu_username, Settings::values.yuzu_token);
-#else
- backend = std::make_unique<Telemetry::NullVisitor>();
-#endif
// Log one-time top-level information
AddField(Telemetry::FieldType::None, "TelemetryId", GetTelemetryId());
@@ -175,9 +169,14 @@ TelemetrySession::~TelemetrySession() {
.count()};
AddField(Telemetry::FieldType::Session, "Shutdown_Time", shutdown_time);
+#ifdef ENABLE_WEB_SERVICE
+ auto backend = std::make_unique<WebService::TelemetryJson>(
+ Settings::values.web_api_url, Settings::values.yuzu_username, Settings::values.yuzu_token);
+#else
+ auto backend = std::make_unique<Telemetry::NullVisitor>();
+#endif
+
// Complete the session, submitting to web service if necessary
- // This is just a placeholder to wrap up the session once the core completes and this is
- // destroyed. This will be moved elsewhere once we are actually doing real I/O with the service.
field_collection.Accept(*backend);
if (Settings::values.enable_telemetry)
backend->Complete();
@@ -186,6 +185,8 @@ TelemetrySession::~TelemetrySession() {
bool TelemetrySession::SubmitTestcase() {
#ifdef ENABLE_WEB_SERVICE
+ auto backend = std::make_unique<WebService::TelemetryJson>(
+ Settings::values.web_api_url, Settings::values.yuzu_username, Settings::values.yuzu_token);
field_collection.Accept(*backend);
return backend->SubmitTestcase();
#else
diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h
index 023612b79..cae5a45a0 100644
--- a/src/core/telemetry_session.h
+++ b/src/core/telemetry_session.h
@@ -39,7 +39,6 @@ public:
private:
Telemetry::FieldCollection field_collection; ///< Tracks all added fields for the session
- std::unique_ptr<Telemetry::VisitorInterface> backend; ///< Backend interface that logs fields
};
/**