Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Automat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯佳佳
Automat
Commits
e63aad72
Commit
e63aad72
authored
Nov 17, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
4a9e4e7d
e62fecde
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
14 deletions
+1
-14
myapps/sukang24h/api/rent_portal.py
+0
-13
sukang_app.py
+1
-1
No files found.
myapps/sukang24h/api/rent_portal.py
View file @
e63aad72
...
@@ -153,17 +153,6 @@ def wx_pay_callback():
...
@@ -153,17 +153,6 @@ def wx_pay_callback():
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
)
.
first
()
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
)
.
first
()
try
:
try
:
lock_time
=
0
while
lock_time
<
3
:
# redis 加锁
lock_res
=
redis_client
.
set
(
RENT_SALE_LOCK
+
str
(
machine
.
id
),
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
ex
=
60
,
nx
=
True
)
if
lock_res
:
break
lock_time
+=
1
time
.
sleep
(
1
)
rent
=
Rent
()
rent
=
Rent
()
rent
.
rent_no
=
rent_no
rent
.
rent_no
=
rent_no
rent
.
machine_no
=
machine
.
machine_no
rent
.
machine_no
=
machine
.
machine_no
...
@@ -216,10 +205,8 @@ def wx_pay_callback():
...
@@ -216,10 +205,8 @@ def wx_pay_callback():
db
.
session
.
commit
()
db
.
session
.
commit
()
except
Exception
as
e
:
except
Exception
as
e
:
redis_client
.
delete
(
RENT_SALE_LOCK
+
str
(
machine
.
id
))
return
xmltodict
.
unparse
({
'xml'
:
error_data
},
pretty
=
True
),
header
return
xmltodict
.
unparse
({
'xml'
:
error_data
},
pretty
=
True
),
header
redis_client
.
delete
(
RENT_SALE_LOCK
+
str
(
machine
.
machine_id
))
return
xmltodict
.
unparse
({
'xml'
:
response_data
},
pretty
=
True
),
header
return
xmltodict
.
unparse
({
'xml'
:
response_data
},
pretty
=
True
),
header
...
...
sukang_app.py
View file @
e63aad72
...
@@ -13,4 +13,4 @@ app = create_app(os.getenv('RUN_ENV', 'prod'))
...
@@ -13,4 +13,4 @@ app = create_app(os.getenv('RUN_ENV', 'prod'))
logger
.
info
(
"run server"
)
logger
.
info
(
"run server"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
app
.
run
(
'127.0.0.1'
,
8893
,
debug
=
Tru
e
)
app
.
run
(
'127.0.0.1'
,
8893
,
debug
=
Fals
e
)
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