Skip to content

Instantly share code, notes, and snippets.

@abhishekctn
Created April 26, 2012 04:24
Show Gist options
  • Save abhishekctn/2495802 to your computer and use it in GitHub Desktop.
Save abhishekctn/2495802 to your computer and use it in GitHub Desktop.
Push stuck order
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