1
This commit is contained in:
parent
8f6f2a0156
commit
5135f15c5d
@ -70,7 +70,8 @@ def fetchConfirmedOrderList():
|
||||
print(e)
|
||||
return
|
||||
|
||||
def sendOneOrder(idx, orderid):
|
||||
def sendOneOrder(conf, idx, orderid):
|
||||
global notifyapi_json
|
||||
try:
|
||||
conn = getMysqlConn('')
|
||||
cursor = conn.cursor()
|
||||
@ -79,8 +80,7 @@ def sendOneOrder(idx, orderid):
|
||||
row = cursor.fetchone()
|
||||
if (not row) or (row[0] != 1):
|
||||
return True
|
||||
print(row[3])
|
||||
if row[6] == '0':
|
||||
if row[6] == 0:
|
||||
timestamp = time.time()
|
||||
params = {
|
||||
'account_id' : row[1],
|
||||
@ -90,10 +90,10 @@ def sendOneOrder(idx, orderid):
|
||||
}
|
||||
secret = 'fc38349c5d084e920925e614c420be9f'
|
||||
md5signstr = md5Sign(params, secret, timestamp)
|
||||
url = conf['notify_url'] + '×tamp=' + str(timestamp) + '&sign=' + md5signstr
|
||||
url = notifyapi_json[str(row[5])]['notify_url'] + '×tamp=' + str(timestamp) + '&sign=' + md5signstr
|
||||
req = urllib.request.Request(url)
|
||||
# data = urllib.request.urlopen(req).read()
|
||||
# jsonobj = json.loads(data)
|
||||
data = urllib.request.urlopen(req).read()
|
||||
jsonobj = json.loads(data)
|
||||
info('sendNotify end')
|
||||
return True
|
||||
except Exception as e:
|
||||
@ -107,7 +107,7 @@ def sendNotify(conf, sendtime):
|
||||
handled_cout = 0
|
||||
while len(confirmed_order_list) > 0 and handled_cout < 50:
|
||||
confirmed_order = confirmed_order_list[0]
|
||||
if sendOneOrder(confirmed_order['idx'], confirmed_order['orderid']):
|
||||
if sendOneOrder(conf, confirmed_order['idx'], confirmed_order['orderid']):
|
||||
confirmed_order_list.pop(0)
|
||||
handled_cout += 1
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user