mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +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
|
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():
|
def preexec_fn():
|
||||||
os.setsid()
|
os.setsid()
|
||||||
if cpu_limit:
|
if cpu_limit:
|
||||||
@ -562,7 +562,11 @@ class runbot_build(osv.osv):
|
|||||||
lock(lock_path)
|
lock(lock_path)
|
||||||
out=open(log_path,"w")
|
out=open(log_path,"w")
|
||||||
_logger.debug("spawn: %s stdout: %s", ' '.join(cmd), log_path)
|
_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
|
return p.pid
|
||||||
|
|
||||||
def github_status(self, cr, uid, ids, context=None):
|
def github_status(self, cr, uid, ids, context=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user