|
@@ -22,8 +22,6 @@ import fire
|
|
|
#pymysql.install_as_MySQLdb()
|
|
|
|
|
|
|
|
|
-db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
|
|
|
-table=db['sns_log']
|
|
|
driver = None
|
|
|
|
|
|
|
|
@@ -48,6 +46,8 @@ def empty_query(q):
|
|
|
|
|
|
|
|
|
def process_query(qs):
|
|
|
+ db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
|
|
|
+ table=db['sns_log']
|
|
|
q=qs[0]
|
|
|
url=qs[1]
|
|
|
client=qs[2]
|
|
@@ -80,7 +80,7 @@ def process_query(qs):
|
|
|
time.sleep(5)
|
|
|
break
|
|
|
idx+=1
|
|
|
-
|
|
|
+ db.close()
|
|
|
def run_once(q):
|
|
|
global driver
|
|
|
s = Service('/root/driver/chromedriver')
|