Fix the tutorial's user events

This commit is contained in:
Joseph Schorr 2015-04-03 12:13:33 -04:00
parent 036c8e56e0
commit 094f91fb8b
3 changed files with 19 additions and 20 deletions

View file

@ -1,6 +1,9 @@
import redis
import json
import threading
import logging
logger = logging.getLogger(__name__)
class UserEventBuilder(object):
"""
@ -68,8 +71,9 @@ class UserEvent(object):
def conduct():
try:
self.publish_event_data_sync(event_id, data_obj)
except Exception as e:
print e
logger.debug('Published user event %s: %s', event_id, data_obj)
except Exception:
logger.exception('Could not publish user event')
thread = threading.Thread(target=conduct)
thread.start()