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

async for suixingpay

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