Skip to content

Commit

Permalink
add support to process session_duration when end_session
Browse files Browse the repository at this point in the history
because when using API directly, sometimes it doesn't send session_duration every 30 sec.
  • Loading branch information
zdwalter committed Jul 4, 2012
1 parent acd3b92 commit 998bbf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/api.js
Expand Up @@ -108,6 +108,9 @@ function processUserLocation(getParams) {
processUserSession(dbAppUser, getParams);
});
} else if (getParams.is_end_session) {
if (getParams.session_duration) {
processSessionDuration(getParams);
}
countlyDb.collection('app_users').findOne({'_id': getParams.app_user_id }, function(err, dbAppUser){
if (!dbAppUser || !dbAppUser['session_duration']) {
return false;
Expand Down Expand Up @@ -458,4 +461,4 @@ http.Server(function(req, res) {
res.end();
break;
}
}).listen(port);
}).listen(port);

0 comments on commit 998bbf0

Please sign in to comment.