Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.toolbox
Commits
90efdf36
Commit
90efdf36
authored
Sep 02, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: hack to let supervisord start before runner
parent
69de2cbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
slapos/runner/__init__.py
slapos/runner/__init__.py
+10
-1
No files found.
slapos/runner/__init__.py
View file @
90efdf36
...
...
@@ -13,6 +13,7 @@ from slapos.runner.process import setHandler
import
sys
from
slapos.runner.utils
import
runInstanceWithLock
from
slapos.runner.views
import
*
import
time
TRUE_VALUES
=
(
1
,
'1'
,
True
,
'true'
,
'True'
)
...
...
@@ -130,11 +131,19 @@ def serve(config):
app
.
logger
.
addHandler
(
config
.
logger
)
app
.
logger
.
info
(
'Running slapgrid...'
)
if
app
.
config
[
'auto_deploy_instance'
]
in
TRUE_VALUES
:
runInstanceWithLock
(
app
.
config
)
import
thread
# XXX-Nicolas: Hack to be sure that supervisord has started
# before any communication with it, so that gunicorn doesn't exit
thread
.
start_new_thread
(
waitForRun
,
(
app
.
config
,))
config
.
logger
.
info
(
'Done.'
)
app
.
wsgi_app
=
ProxyFix
(
app
.
wsgi_app
)
def
waitForRun
(
config
):
time
.
sleep
(
3
)
runInstanceWithLock
(
config
)
def
getUpdatedParameter
(
self
,
var
):
configuration_parser
=
ConfigParser
.
SafeConfigParser
()
configuration_file_path
=
os
.
path
.
abspath
(
os
.
getenv
(
'RUNNER_CONFIG'
))
...
...
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