Commit 15d0a2a9 authored by 周尚's avatar 周尚

async for suixingpay

parent 888d4566
......@@ -65,12 +65,20 @@ local function async_db(ins_sql)
db:set_keepalive(10000, 100)
end
local function async()
ngx.say("SUCCESS")
local function eof()
if ngx.var.host == "icm-test.suixingpay.com" then
ngx.say("{\"code\":\"success\", \"msg\":\"成功\"}")
else
ngx.say("SUCCESS")
end
ngx.eof()
end
local function async()
eof()
local ins_sql = async_sql_ins()
async_db(ins_sql)
-- local ins_sql = async_sql_ins()
-- async_db(ins_sql)
end
async()
......
......@@ -63,16 +63,16 @@ handler = function(premature, now_time)
-- node_smsvip: run()
-- node_vipacct: run()
tk_sync: run()
node_card: run(now_time)
node_ticket: run(now_time)
tk_sdt: run(now_time)
-- tk_sync: run()
-- node_card: run(now_time)
-- node_ticket: run(now_time)
-- tk_sdt: run(now_time)
-- local handle = io.popen("curl localhost:8080/settle")
-- if handle then
-- handle:close()
-- end
local handle = io.popen("curl localhost:8080/settle")
if handle then
handle:close()
end
-- -- reset now_time
-- now_time = tostring(tonumber(now_time) - 1)
......@@ -82,9 +82,9 @@ handler = function(premature, now_time)
-- now_time = zx_base:date2time(settledate)
-- end
-- nxt_time = zx_base:date2time(os.date("%Y-%m-%d 00:30:00", os.time()+24*60*60))
-- now_time = os.time();
-- delay = nxt_time - now_time;
nxt_time = zx_base:date2time(os.date("%Y-%m-%d 00:30:00", os.time()+24*60*60))
now_time = os.time();
delay = nxt_time - now_time;
local ok, err = ngx.timer.every(24 * 60 * 60, handler, now_time)
if not ok then
ngx.log(ngx.ERR, "failed to create the timer:", err)
......
......@@ -539,14 +539,14 @@ local function sdt_sql(tk_biz, tk_control, total_time)
return
end
-- -- INSERT INTO tk_control database
-- res, err, errcode, sqlstate = db_control:query(str)
-- ngx.log(ngx.NOTICE, str)
-- if not res then
-- ngx.log(ngx.ERR, "failed to query:", json.encode(tk_control),
-- ":", err, ":", errcode, ":", sqlstate, ".")
-- -- return
-- end
-- INSERT INTO tk_control database
res, err, errcode, sqlstate = db_control:query(str)
ngx.log(ngx.NOTICE, str)
if not res then
ngx.log(ngx.ERR, "failed to query:", json.encode(tk_control),
":", err, ":", errcode, ":", sqlstate, ".")
-- return
end
-- table.insert(shops, shop)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment