Commit 71c23e94 authored by Nicolas Wavrant's avatar Nicolas Wavrant

the auto-deployment is made in a new thread, so it doesn't block the server

parent c8ab1273
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import logging import logging
import md5 import md5
import multiprocessing import multiprocessing
import thread
import re import re
import shutil import shutil
import os import os
...@@ -817,6 +818,10 @@ def cloneDefaultGit(config): ...@@ -817,6 +818,10 @@ def cloneDefaultGit(config):
} }
cloneRepo(data) cloneRepo(data)
def buildAndRun(config):
runSoftwareWithLock(config)
runInstanceWithLock(config)
def setupDefaultSR(config): def setupDefaultSR(config):
"""If a default_sr is in the parameters, """If a default_sr is in the parameters,
and no SR is deployed yet, setup it and no SR is deployed yet, setup it
...@@ -825,5 +830,4 @@ def setupDefaultSR(config): ...@@ -825,5 +830,4 @@ def setupDefaultSR(config):
if not os.path.exists(project) and config['default_sr'] != '': if not os.path.exists(project) and config['default_sr'] != '':
configNewSR(config, config['default_sr']) configNewSR(config, config['default_sr'])
if config['auto_deploy']: if config['auto_deploy']:
runSoftwareWithLock(config) thread.start_new_thread(buildAndRun, (config,))
runInstanceWithLock(config)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment