Commit 0967cc16 authored by 周尚's avatar 周尚

add test_settle.py script for settle test

parent e9a9c211
......@@ -2,3 +2,4 @@
bin
sbin
logs
.mypy_cache
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import datetime
b = datetime.date(2018, 5, 1)
e = datetime.date.today()
delta = datetime.timedelta(days=1)
d = b
while d <= e:
cmd = "curl localhost:8080/settle?total_date={}".format(
d.strftime("%Y-%m-%d"))
os.system(cmd)
d += delta
......@@ -5,7 +5,6 @@ local TK_SDT = {}
local mysql = _G.loadmod("resty.mysql")
local json = _G.loadmod('cjson')
local db_biz -- tk_biz handle
local db_control -- tk_control handle
......@@ -119,7 +118,8 @@ local function sdt_sql(tk_biz, tk_control, total_time)
return
end
if #res ~= 0 then
log_lua:log(log_lua:__FILE__() .. ":" .. log_lua:__LINE__(), "NOTICE: " .. shop['shop_map_id'],
log_lua:log(log_lua:__FILE__() .. ":" .. log_lua:__LINE__(), "NOTICE: " ,
shop['shop_map_id'] .. "-" .. os.date("%Y%m%d"),
" finished already")
break
end
......
-- dbs config
_G.loadmod ('luainit.db_conf')
require ('luainit.db_conf')
-- custom base module
_G.zx_base = _G.zx_base or require('luabiz.zx_base')
......
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