Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
jobmanager
Commits
f12917b8
Commit
f12917b8
authored
Nov 06, 2017
by
Andreas Valder
Browse files
reduced load produced by workers
parent
2e021a88
Changes
1
Hide whitespace changes
Inline
Side-by-side
manager.py
View file @
f12917b8
...
...
@@ -38,7 +38,7 @@ api = WorkerApi(config['API']['BASE'],config['API']['KEY'])
threading
.
Thread
(
target
=
run_scheduler
,
daemon
=
True
).
start
()
@
sched_func
(
5
)
@
sched_func
(
1
5
)
def
ping_website_for_host
():
# ping so the website knows our host is still alive
if
not
api
.
worker_ping
():
...
...
@@ -58,7 +58,8 @@ while True:
continue
j
=
api
.
worker_schedule
(
config
[
'JOBS'
][
'TYPES'
])
if
not
j
:
time
.
sleep
(
1
)
time
.
sleep
(
30
)
continue
print
(
"started jobid %i"
%
j
[
'id'
])
procs
.
append
(
subprocess
.
Popen
([
'./worker.py'
,
str
(
j
[
'id'
]),
str
(
j
[
'type'
]),
str
(
j
[
'priority'
])
,
str
(
j
[
'data'
])
]
))
time
.
sleep
(
1
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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