| Line 25... |
Line 25... |
| 25 |
parser.add_option("-M", "--mongoHost", dest="mongoHost",
|
25 |
parser.add_option("-M", "--mongoHost", dest="mongoHost",
|
| 26 |
default="localhost",
|
26 |
default="localhost",
|
| 27 |
type="str", help="The requsets a single thread handles",
|
27 |
type="str", help="The requsets a single thread handles",
|
| 28 |
metavar="MONGOHOST")
|
28 |
metavar="MONGOHOST")
|
| 29 |
parser.add_option("-m", "--mysqlHost", dest="mysqlHost",
|
29 |
parser.add_option("-m", "--mysqlHost", dest="mysqlHost",
|
| 30 |
default="localhost",
|
30 |
default="127.0.0.1",
|
| 31 |
type="str", help="The requsets a single thread handles",
|
31 |
type="str", help="The requsets a single thread handles",
|
| 32 |
metavar="MONGOHOST")
|
32 |
metavar="MONGOHOST")
|
| 33 |
|
33 |
|
| 34 |
(options, args) = parser.parse_args()
|
34 |
(options, args) = parser.parse_args()
|
| 35 |
|
35 |
|
| Line 54... |
Line 54... |
| 54 |
gcmIdGcmRegIdMap = {}
|
54 |
gcmIdGcmRegIdMap = {}
|
| 55 |
domainStoresMap = {}
|
55 |
domainStoresMap = {}
|
| 56 |
failedGcm = []
|
56 |
failedGcm = []
|
| 57 |
|
57 |
|
| 58 |
|
58 |
|
| 59 |
db = MySQLdb.connect(options.mysqlHost,"root","shop2020","127.0.0.1" )
|
59 |
db = MySQLdb.connect(options.mysqlHost,"root","shop2020","dtr" )
|
| 60 |
cursor = db.cursor()
|
60 |
cursor = db.cursor()
|
| 61 |
|
61 |
|
| 62 |
ALL_STORES_SQL = "select * from stores"
|
62 |
ALL_STORES_SQL = "select * from stores"
|
| 63 |
GCM_REG_ID_SQL1 = "select x.user_id, x.gcm_regid, x.id, x.androidid, x.created from (select gc.* from gcm_users gc join users u on gc.user_id=u.id where gc.user_id in (%s) and gc.androidid is not null and u.activated=1 order by gc.id desc) as x group by x.user_id, x.gcm_regid, x.androidid"
|
63 |
GCM_REG_ID_SQL1 = "select x.user_id, x.gcm_regid, x.id, x.androidid, x.created from (select gc.* from gcm_users gc join users u on gc.user_id=u.id where gc.user_id in (%s) and gc.androidid is not null and u.activated=1 order by gc.id desc) as x group by x.user_id, x.gcm_regid, x.androidid"
|
| 64 |
GCM_REG_ID_SQL2 = "select x.user_id, x.gcm_regid, x.id, x.androidid, x.created, x.imeinumber from (select gc.* from gcm_users gc join users u on u.id=gc.user_id where gc.user_id in (%s) and gc.androidid is null and gc.imeinumber and u.activated=1 is not null order by id desc) as x group by x.user_id, x.imeinumber"
|
64 |
GCM_REG_ID_SQL2 = "select x.user_id, x.gcm_regid, x.id, x.androidid, x.created, x.imeinumber from (select gc.* from gcm_users gc join users u on u.id=gc.user_id where gc.user_id in (%s) and gc.androidid is null and gc.imeinumber and u.activated=1 is not null order by id desc) as x group by x.user_id, x.imeinumber"
|