Update index.py

pull/624/head
Mr Chen 8 months ago
parent 5c9a12a7b2
commit 26a29fea96
  1. 11
      plugins/acme_pandominassl_apply/index.py

@ -550,9 +550,11 @@ def domainApplyPathJudge(domain):
def hookWriteLog(line): def hookWriteLog(line):
hook_log = runLog() hook_file = runLog()
mdate = time.strftime('%Y-%m-%d %X', time.localtime()) mdate = time.strftime('%Y-%m-%d %X', time.localtime())
return mw.writeFile(hook_log,"["+mdate+"]:"+line+"\n",'a+') log = "["+mdate+"]:"+line
print(log)
return mw.writeFile(hook_file,log+"\n",'a+')
def runHookPy(domain,path): def runHookPy(domain,path):
# print(domain,path) # print(domain,path)
@ -591,7 +593,8 @@ def runHookDstDomain(row):
day = (now_int - effective_date)/86400 day = (now_int - effective_date)/86400
# print(effective_date,now_int,day) # print(effective_date,now_int,day)
if int(day) < 8: if int(day) < 8:
hookWriteLog(''+domain+'】未过期') common_log = ''+domain+'】未过期'
hookWriteLog(common_log)
return return
hookWriteLog('开始申请【'+domain+'】SSL证书') hookWriteLog('开始申请【'+domain+'】SSL证书')
@ -662,8 +665,8 @@ def runHook():
clist = conn.field(field).where('status=?',(1,)).limit('1000').order('id desc').select() clist = conn.field(field).where('status=?',(1,)).limit('1000').order('id desc').select()
for idx in range(len(clist)): for idx in range(len(clist)):
# print(clist)
row = clist[idx] row = clist[idx]
# print(row)
runHookDstDomain(row) runHookDstDomain(row)
time.sleep(1) time.sleep(1)
return 'run hook end' return 'run hook end'

Loading…
Cancel
Save