Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fdd67076
authored
Jul 09, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: add timeout to measure_response_time()
parent
d713a4fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
circle/monitor/tasks/local_periodic_tasks.py
+5
-1
No files found.
circle/monitor/tasks/local_periodic_tasks.py
View file @
fdd67076
...
@@ -32,7 +32,11 @@ logger = logging.getLogger(__name__)
...
@@ -32,7 +32,11 @@ logger = logging.getLogger(__name__)
@celery.task
(
ignore_result
=
True
)
@celery.task
(
ignore_result
=
True
)
def
measure_response_time
():
def
measure_response_time
():
r
=
requests
.
get
(
settings
.
DJANGO_URL
,
verify
=
False
)
try
:
r
=
requests
.
get
(
settings
.
DJANGO_URL
,
verify
=
False
,
timeout
=
0.5
)
except
requests
.
exceptions
.
Timeout
:
return
total_miliseconds
=
(
total_miliseconds
=
(
r
.
elapsed
.
seconds
*
10
**
6
+
r
.
elapsed
.
seconds
*
10
**
6
+
r
.
elapsed
.
microseconds
)
/
1000
r
.
elapsed
.
microseconds
)
/
1000
...
...
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