Created
February 16, 2010 21:29
-
-
Save madebysofa/305951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lastSyncedOrderTimestamp = 123456789 # (utc epoch timestamp) | |
# Fetch all orders since last timestamp per 20 | |
ordersToProcess = api.orders.all( | |
since=lastSyncedOrderTimestamp, size=20) | |
# Process the order one by one | |
for order in ordersToProcess: | |
try: | |
crazyOrderConvertToAEFunction(order) | |
except SomeCrazyError: | |
handleError() | |
exit() | |
# Set the new last synced order timestamp | |
lastSyncedOrderTimestamp = order['date'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment