Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-07-10 02:11:01 +0300
committerdiosmosis <benaka@piwik.pro>2015-08-06 17:37:59 +0300
commit2cabc570e84b938920d797ae7999c1ddad28f962 (patch)
tree01394ea42355a5f74db04c1f0c6983dbba1df945 /plugins/Heartbeat
parenta384ae038bda2005d7e5c8bccf88f2d5a90599f2 (diff)
Move last remaining ping request handling logic to PingRequestProcessor from Visit::handle().
Diffstat (limited to 'plugins/Heartbeat')
-rw-r--r--plugins/Heartbeat/Tracker/PingRequestProcessor.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/Heartbeat/Tracker/PingRequestProcessor.php b/plugins/Heartbeat/Tracker/PingRequestProcessor.php
index d513e3f223..9e45e0c057 100644
--- a/plugins/Heartbeat/Tracker/PingRequestProcessor.php
+++ b/plugins/Heartbeat/Tracker/PingRequestProcessor.php
@@ -32,7 +32,17 @@ class PingRequestProcessor extends RequestProcessor
if ($this->isPingRequest($request)) {
$visitProperties->setRequestMetadata('Goals', 'someGoalsConverted', false);
$visitProperties->setRequestMetadata('Goals', 'visitIsConverted', false);
+ // TODO: double check: can this be merged w/ setting action to null?
+
+ // When a ping request is received more than 30 min after the last request/ping,
+ // we choose not to create a new visit.
+ if ($visitProperties->getRequestMetadata('CoreHome', 'isNewVisit')) {
+ Common::printDebug("-> ping=1 request: we do _not_ create a new visit.");
+ return true; // abort request
+ }
}
+
+ return false;
}
private function isPingRequest(Request $request)