diff options
author | diosmosis <benaka@piwik.pro> | 2015-07-10 02:11:01 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-08-06 17:37:59 +0300 |
commit | 2cabc570e84b938920d797ae7999c1ddad28f962 (patch) | |
tree | 01394ea42355a5f74db04c1f0c6983dbba1df945 /plugins/Heartbeat | |
parent | a384ae038bda2005d7e5c8bccf88f2d5a90599f2 (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.php | 10 |
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) |