Clean up mixpanel analytics a bit.
This commit is contained in:
parent
6266dd0ea4
commit
013e27f7d5
1 changed files with 3 additions and 4 deletions
|
@ -37,7 +37,7 @@ class SendToMixpanel(Thread):
|
||||||
logger.exception('Failed to send Mixpanel request.')
|
logger.exception('Failed to send Mixpanel request.')
|
||||||
|
|
||||||
|
|
||||||
class FakeMixpanel(object):
|
class _FakeMixpanel(object):
|
||||||
def track(*args, **kwargs):
|
def track(*args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -55,15 +55,14 @@ class Analytics(object):
|
||||||
|
|
||||||
if analytics_type == 'Mixpanel':
|
if analytics_type == 'Mixpanel':
|
||||||
mixpanel_key = app.config.get('MIXPANEL_KEY', '')
|
mixpanel_key = app.config.get('MIXPANEL_KEY', '')
|
||||||
logger.debug('Initializing mixpanel with key: %s' %
|
logger.debug('Initializing mixpanel with key: %s', app.config['MIXPANEL_KEY'])
|
||||||
app.config['MIXPANEL_KEY'])
|
|
||||||
|
|
||||||
request_queue = Queue()
|
request_queue = Queue()
|
||||||
analytics = Mixpanel(mixpanel_key, MixpanelQueuingConsumer(request_queue))
|
analytics = Mixpanel(mixpanel_key, MixpanelQueuingConsumer(request_queue))
|
||||||
SendToMixpanel(request_queue).start()
|
SendToMixpanel(request_queue).start()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
analytics = FakeMixpanel()
|
analytics = _FakeMixpanel()
|
||||||
|
|
||||||
# register extension with app
|
# register extension with app
|
||||||
app.extensions = getattr(app, 'extensions', {})
|
app.extensions = getattr(app, 'extensions', {})
|
||||||
|
|
Reference in a new issue