[IMP] do not fail if cannot delete the pidfile. It may have a race-condition when in multi-workers.

bzr revid: chs@openerp.com-20140423150117-nyt16snzwvey2vz4
This commit is contained in:
Christophe Simonis 2014-04-23 17:01:17 +02:00
parent 981f683f0f
commit 156225f9ea
1 changed files with 5 additions and 2 deletions

View File

@ -81,8 +81,11 @@ def report_configuration():
def rm_pid_file():
config = openerp.tools.config
if not openerp.evented and os.path.exists(config['pidfile']):
os.unlink(config['pidfile'])
if not openerp.evented and config['pidfile']:
try:
os.unlink(config['pidfile'])
except OSError:
pass
def setup_pid_file():
""" Create a file with the process id written in it.