Skip to content

Instantly share code, notes, and snippets.

@adamrneary
Last active August 29, 2015 14:11
Show Gist options
  • Save adamrneary/4d621c9ce3400723f2dd to your computer and use it in GitHub Desktop.
Save adamrneary/4d621c9ce3400723f2dd to your computer and use it in GitHub Desktop.
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'):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment