Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. diff --git a/application.py b/application.py
  2. index 15cb3eb..a37a14f 100644
  3. --- a/application.py
  4. +++ b/application.py
  5. @@ -11,6 +11,7 @@ from util import ThrottleQueue
  6. from boto.dynamodb.table import Table
  7. from boto.dynamodb.item import Item
  8. from boto import connect_dynamodb
  9. +from boto import connect_kinesis
  10.  
  11. ADVENTR_DEBUG = True if os.environ.get('ADVENTR_DEBUG', '0') == '1' else False
  12.  
  13. @@ -118,6 +119,7 @@ def processFunc(item):
  14. try:
  15. application.logger.debug("Adding item %s" % item)
  16. conn.put_item(item)
  17. + kinesis.put_record('video-events', item)
  18.  
  19. except TypeError, inst:
  20. application.logger.error("TypeError while saving to db: %s obj=%s" % (inst, obj))
  21. @@ -149,6 +151,7 @@ def get_rand_id(x=6):
  22.  
  23. if os.environ.has_key('AWS_ACCESS_KEY_ID'):
  24. conn = connect_dynamodb( os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_KEY'] )
  25. + kinesis = connect_kinesis( os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_KEY'] )
  26.  
  27. wait_seconds = 0.25
  28. if os.environ.has_key('ADVENTR_THROTTLE_SECONDS'):
  29. @@ -167,5 +170,3 @@ TABLES = getEventTables()
  30. if __name__ == '__main__':
  31. #application.run(host='0.0.0.0', debug=True)
  32. application.run(debug=ADVENTR_DEBUG)
  33. -
  34. -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement