Disable analytics.users.active

This commit is contained in:
Matt Lott 2014-12-17 14:17:50 -08:00
parent da72991260
commit 6ab74f9dab
3 changed files with 8 additions and 2 deletions

View file

@ -1,7 +1,7 @@
module.exports.handlers =
# TODO: Disabling this until we know why our app servers CPU grows out of control.
# 'analytics_log_event': 'analytics/analytics_log_event_handler'
'analytics_users_active': 'analytics/analytics_users_active_handler'
# 'analytics_users_active': 'analytics/analytics_users_active_handler'
'article': 'articles/article_handler'
'level': 'levels/level_handler'
'level_component': 'levels/components/level_component_handler'

View file

@ -46,7 +46,9 @@ module.exports.setup = (app) ->
log.error(errorMessage)
log.error(error)
log.error(error.stack)
hipchat.sendTowerHipChatMessage errorMessage
# TODO: Generally ignore this error: error: Error trying db method get route analytics.log.event from undefined: Error: Cannot find module '../undefined'
unless "#{parts}" in ['analytics.log.event', 'analytics.users.active']
hipchat.sendTowerHipChatMessage errorMessage
errors.notFound(res, "Route #{req?.path} not found.")
getSchema = (req, res, moduleName) ->

View file

@ -189,6 +189,8 @@ UserSchema.methods.isPremium = ->
return false
UserSchema.statics.saveActiveUser = (id, event, done=null) ->
# TODO: Disabling this until we know why our app servers CPU grows out of control.
return done?()
id = mongoose.Types.ObjectId id if _.isString id
@findById id, (err, user) ->
if err?
@ -198,6 +200,8 @@ UserSchema.statics.saveActiveUser = (id, event, done=null) ->
done?()
UserSchema.methods.saveActiveUser = (event, done=null) ->
# TODO: Disabling this until we know why our app servers CPU grows out of control.
return done?()
try
return done?() if @isAdmin()
userID = @get('_id')