Changeset - 29e999f26998
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-07-07 13:43:16
marcin@python-works.com
pidlock always create dirs for lock file
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/pidlock.py
Show inline comments
 
@@ -8,6 +8,7 @@ from multiprocessing.util import Finaliz
 

	
 
from rhodecode.lib.compat import kill
 

	
 

	
 
class LockHeld(Exception):
 
    pass
 

	
 
@@ -123,6 +124,10 @@ class DaemonLock(object):
 
        """
 
        if self.debug:
 
            print 'creating a file %s and pid: %s' % (pidfile, lockname)
 

	
 
        dir_, file_ = os.path.split(pidfile)
 
        if not os.path.isdir(dir_):
 
            os.makedirs(dir_)
 
        pidfile = open(self.pidfile, "wb")
 
        pidfile.write(lockname)
 
        pidfile.close
0 comments (0 inline, 0 general)