Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
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
wanli
evm-store
Commits
cc141866
Commit
cc141866
authored
Jul 26, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🌈
style(): 一些不重要的更新
parent
58053bf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
24 deletions
+4
-24
tools/build_out/tests/http_interval.py
tools/build_out/tests/http_interval.py
+4
-24
No files found.
tools/build_out/tests/http_interval.py
View file @
cc141866
'''
'''
Author: your name
Author: your name
Date: 2021-07-22 19:01:41
Date: 2021-07-22 19:01:41
LastEditTime: 2021-07-26 1
6:51:21
LastEditTime: 2021-07-26 1
3:05:19
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\t
ests
\
http_interval.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\t
ests
\
http_interval.py
'''
'''
import
json
import
json
import
time
import
time
import
signal
import
random
import
random
import
requests
import
requests
from
threading
import
Timer
,
Thread
from
threading
import
Timer
,
Thread
thread_list
=
[]
def
sig_handler
(
sig
,
frame
):
try
:
global
thread_list
for
t
in
thread_list
:
t
.
stop
()
t
.
join
()
except
Exception
as
e
:
print
(
e
)
exit
(
0
)
def
send_request
(
imei
):
def
send_request
(
imei
):
payload
=
{
payload
=
{
...
@@ -106,7 +94,7 @@ def send_request(imei):
...
@@ -106,7 +94,7 @@ def send_request(imei):
'png_file_size'
:
random
.
randint
(
0
,
10000
)
'png_file_size'
:
random
.
randint
(
0
,
10000
)
})
})
r
=
requests
.
post
(
"http://
localhost:3000
/api/v1/evm_store/monitor"
,
data
=
json
.
dumps
(
payload
))
r
=
requests
.
post
(
"http://
store.evmiot.com
/api/v1/evm_store/monitor"
,
data
=
json
.
dumps
(
payload
))
print
(
r
.
status_code
)
print
(
r
.
status_code
)
print
(
r
.
json
())
print
(
r
.
json
())
...
@@ -131,22 +119,14 @@ class myThread(Thread):
...
@@ -131,22 +119,14 @@ class myThread(Thread):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# send_request()
# send_request()
signal
.
signal
(
signal
.
SIGTERM
,
sig_handler
)
signal
.
signal
(
signal
.
SIGINT
,
sig_handler
)
# 创建新线程
# 创建新线程
thread1
=
myThread
(
1
,
"Thread-1"
,
1
,
"352099001761481"
)
thread1
=
myThread
(
1
,
"Thread-1"
,
1
,
"352099001761481"
)
thread2
=
myThread
(
2
,
"Thread-2"
,
2
,
"866866040000447"
)
thread2
=
myThread
(
2
,
"Thread-2"
,
2
,
"866866040000447"
)
thread_list
.
append
(
thread1
)
thread_list
.
append
(
thread2
)
thread1
.
setDaemon
(
'True'
)
thread1
.
setDaemon
(
'True'
)
# 开启新线程
# 开启新线程
thread1
.
start
()
thread1
.
start
()
thread2
.
start
()
thread2
.
start
()
#
thread1.join()
thread1
.
join
()
#
thread2.join()
thread2
.
join
()
print
(
"退出主线程"
)
print
(
"退出主线程"
)
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