notify wcs synchronously for now, with a short timeout
This commit is contained in:
parent
af28ed5275
commit
a68abcc60e
|
@ -81,7 +81,7 @@ class BasketItem(models.Model):
|
|||
url = self.source_url + 'jump/trigger/paid?email=trigger@localhost&orig=combo'
|
||||
url = sign_url(url, key='xxx')
|
||||
message = {'result': 'ok'}
|
||||
r = requests.post(url, data=json.dumps(message))
|
||||
r = requests.post(url, data=json.dumps(message), timeout=3)
|
||||
self.notification_date = datetime.datetime.now()
|
||||
self.save()
|
||||
|
||||
|
|
|
@ -135,5 +135,9 @@ class CallbackView(View):
|
|||
for item in transaction.items.all():
|
||||
item.payment_date = transaction.end_date
|
||||
item.save()
|
||||
thread.start_new_thread(item.notify, ())
|
||||
try:
|
||||
item.notify()
|
||||
except:
|
||||
# ignore errors, it will be retried later on if it fails
|
||||
pass
|
||||
return HttpResponseRedirect('/')
|
||||
|
|
Reference in New Issue