~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/lockfile.py

  • Committer: Michael Hudson
  • Date: 2009-02-11 19:20:51 UTC
  • mfrom: (266.2.17 clean-up-inventory-view)
  • Revision ID: michael.hudson@canonical.com-20090211192051-a19byfoyaaq581f1
clean up the inventory view and beef up the tests of the same

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
            self._count += 1
58
58
            return True
59
59
        try:
60
 
            fd = os.open(self._filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0600)
 
60
            fd = os.open(self._filename,
 
61
                         os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0600)
61
62
            os.close(fd)
62
63
            self._count += 1
63
64
            return True
65
66
            return False
66
67
 
67
68
    def acquire(self):
68
 
        # try over and over, sleeping on exponential backoff with an upper limit of about 5 seconds
 
69
        # try over and over, sleeping on exponential backoff with
 
70
        # an upper limit of about 5 seconds
69
71
        pause = 0.1
70
72
        #max_pause = 5.0
71
73
        max_pause = 0.1