Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tornado.ioloop import IOLoop
- from api import db
- from api.users.user_purchases.actions.driver import queue_message_for_action
- from api.users.user_purchases.actions.constants import UserPurchaseActions
- USER_PURCHASE_IDS = [
- # Add purchase IDs with unsent emails here.
- ]
- if __name__ == '__main__':
- session = db.Session()
- total = len(USER_PURCHASE_IDS)
- # Generate report
- for i, user_purchase_id in enumerate(USER_PURCHASE_IDS):
- IOLoop.current().run_sync(
- lambda: queue_message_for_action(session, user_purchase_id, UserPurchaseActions.NOTIFY_FULFILLED_EMAIL)
- )
- print('[{}/{}] queued message for user_purchase {}'.format(i, total, user_purchase_id))
- print('Done')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement