Created
April 26, 2012 04:24
-
-
Save abhishekctn/2495802 to your computer and use it in GitHub Desktop.
Push stuck order
This file contains hidden or 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
import time | |
from queue.tasks import submit_order_handler | |
def resave_stuck_orders(): | |
stuck_orders = Order.objects.filter(time__gte="2012-04-16").filter(payment_gateway_transaction_id__isnull=False).filter(has_rms_order_id__exact=False) | |
for order in stuck_orders: | |
print "re-saving order: %s\n" % order | |
order.save() | |
print "order: %s\n" % order.id | |
print "starting sleep\n\n" | |
time.sleep(30) | |
resave_stuck_orders() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment