Fix the forking problem in the buildserver.
This commit is contained in:
parent
c91b40f356
commit
7f17c6da24
1 changed files with 9 additions and 10 deletions
|
@ -146,7 +146,15 @@ build = {
|
||||||
pool = ThreadPool(1)
|
pool = ThreadPool(1)
|
||||||
|
|
||||||
|
|
||||||
def start_build(resource_url, tag_name, acccess_token):
|
@app.before_first_request
|
||||||
|
def start_build():
|
||||||
|
resource_url = os.environ['RESOURCE_URL']
|
||||||
|
tag_name = os.environ['TAG']
|
||||||
|
acccess_token = os.environ['TOKEN']
|
||||||
|
|
||||||
|
logger.debug('Starting job with resource url: %s tag: %s and token: %s' %
|
||||||
|
(resource_url, tag_name, acccess_token))
|
||||||
|
|
||||||
# Save the token
|
# Save the token
|
||||||
host = re.match(r'([a-z0-9.:]+)/.+/.+$', tag_name)
|
host = re.match(r'([a-z0-9.:]+)/.+/.+$', tag_name)
|
||||||
if host:
|
if host:
|
||||||
|
@ -201,13 +209,4 @@ def health_check():
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
|
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
|
||||||
resource_url = os.environ['RESOURCE_URL']
|
|
||||||
tag_name = os.environ['TAG']
|
|
||||||
acccess_token = os.environ['TOKEN']
|
|
||||||
|
|
||||||
logger.debug('Starting job with resource url: %s tag: %s and token: %s' %
|
|
||||||
(resource_url, tag_name, acccess_token))
|
|
||||||
|
|
||||||
start_build(resource_url, tag_name, acccess_token)
|
|
||||||
|
|
||||||
app.run(host='0.0.0.0', port=5002)
|
app.run(host='0.0.0.0', port=5002)
|
||||||
|
|
Reference in a new issue