mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
Avoid getting broken pipe errors in logs
This commit is contained in:
parent
4413315e86
commit
ad834107c3
@ -548,7 +548,7 @@ class runbot_build(osv.osv):
|
||||
|
||||
return cmd, mods
|
||||
|
||||
def spawn(self, cmd, lock_path, log_path, cpu_limit=None, shell=False):
|
||||
def spawn(self, cmd, lock_path, log_path, cpu_limit=None, shell=False, hidestderr=False):
|
||||
def preexec_fn():
|
||||
os.setsid()
|
||||
if cpu_limit:
|
||||
@ -562,7 +562,11 @@ class runbot_build(osv.osv):
|
||||
lock(lock_path)
|
||||
out=open(log_path,"w")
|
||||
_logger.debug("spawn: %s stdout: %s", ' '.join(cmd), log_path)
|
||||
p=subprocess.Popen(cmd, stdout=out, stderr=out, preexec_fn=preexec_fn, shell=shell)
|
||||
if hidestderr:
|
||||
stderr = out
|
||||
else:
|
||||
stderr = open(os.devnull, 'w')
|
||||
p=subprocess.Popen(cmd, stdout=out, stderr=stderr, preexec_fn=preexec_fn, shell=shell)
|
||||
return p.pid
|
||||
|
||||
def github_status(self, cr, uid, ids, context=None):
|
||||
|
Loading…
Reference in New Issue
Block a user