1
This commit is contained in:
parent
780c9797e4
commit
ea0afa13a7
@ -11,6 +11,7 @@ import json
|
||||
import time
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
import pymysql
|
||||
|
||||
CONFIG_DIR = '../config' if f7.isOnlineEnv() else '/var/data/conf_test/mailsender/config'
|
||||
RES_DIR = '../res' if f7.isOnlineEnv() else '/var/data/conf_test/mailsender/res'
|
||||
@ -21,6 +22,8 @@ def httpGet(url, params):
|
||||
param = urllib.parse.urlencode(params)
|
||||
url = url + param
|
||||
response = urllib.request.urlopen(url=url)
|
||||
print(url)
|
||||
print(response)
|
||||
|
||||
def getMailConf(mailid):
|
||||
mail_conf = json.loads(open(RES_DIR + '/6000@game2005.mail.json', 'r').read())
|
||||
@ -58,6 +61,7 @@ def sendVipLvUpMail(account_id, old_vip_lv, new_vip_lv):
|
||||
httpGet(url, params)
|
||||
|
||||
def fetchEvent():
|
||||
print('fetchEvent')
|
||||
global db_idx_hash
|
||||
mysql_cluster_conf = json.loads(open(CONFIG_DIR + '/mailsender.mysql.cluster.json', 'r').read())
|
||||
for conf in mysql_cluster_conf:
|
||||
@ -77,6 +81,7 @@ def fetchEvent():
|
||||
'LIMIT 0, 1000'
|
||||
% (last_idx))
|
||||
for row in cursor:
|
||||
print(row)
|
||||
last_idx = max(row[0], last_idx)
|
||||
time.sleep(0.001);
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user