Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openresty
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tangku7
openresty
Commits
0967cc16
Commit
0967cc16
authored
Sep 27, 2018
by
周尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test_settle.py script for settle test
parent
e9a9c211
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
3 deletions
+20
-3
.gitignore
.gitignore
+1
-0
nginx/lua/luabiz/setup.py
nginx/lua/luabiz/setup.py
+0
-0
nginx/lua/luabiz/test_settle.py
nginx/lua/luabiz/test_settle.py
+16
-0
nginx/lua/luabiz/tk_sdt.lua
nginx/lua/luabiz/tk_sdt.lua
+2
-2
nginx/lua/luainit/mods.lua
nginx/lua/luainit/mods.lua
+1
-1
No files found.
.gitignore
View file @
0967cc16
...
...
@@ -2,3 +2,4 @@
bin
sbin
logs
.mypy_cache
nginx/lua/luabiz/setup.py
0 → 100644
View file @
0967cc16
nginx/lua/luabiz/test_settle.py
0 → 100644
View file @
0967cc16
#!/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
nginx/lua/luabiz/tk_sdt.lua
View file @
0967cc16
...
...
@@ -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
...
...
nginx/lua/luainit/mods.lua
View file @
0967cc16
-- 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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment