Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/application.py b/application.py
- index 15cb3eb..a37a14f 100644
- --- a/application.py
- +++ b/application.py
- @@ -11,6 +11,7 @@ from util import ThrottleQueue
- from boto.dynamodb.table import Table
- from boto.dynamodb.item import Item
- from boto import connect_dynamodb
- +from boto import connect_kinesis
- ADVENTR_DEBUG = True if os.environ.get('ADVENTR_DEBUG', '0') == '1' else False
- @@ -118,6 +119,7 @@ def processFunc(item):
- try:
- application.logger.debug("Adding item %s" % item)
- conn.put_item(item)
- + kinesis.put_record('video-events', item)
- except TypeError, inst:
- application.logger.error("TypeError while saving to db: %s obj=%s" % (inst, obj))
- @@ -149,6 +151,7 @@ def get_rand_id(x=6):
- if os.environ.has_key('AWS_ACCESS_KEY_ID'):
- conn = connect_dynamodb( os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_KEY'] )
- + kinesis = connect_kinesis( os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_KEY'] )
- wait_seconds = 0.25
- if os.environ.has_key('ADVENTR_THROTTLE_SECONDS'):
- @@ -167,5 +170,3 @@ TABLES = getEventTables()
- if __name__ == '__main__':
- #application.run(host='0.0.0.0', debug=True)
- application.run(debug=ADVENTR_DEBUG)
- -
- -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement