Skip to content

Commit

Permalink
Update filelock.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mgermain committed Apr 22, 2016
1 parent 5cf5410 commit 35f008c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions smartdispatch/filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def open_with_flock(*args, **kwargs):
except IOError as e:
if e.errno == errno.EDEADLK:
logging.warn("The OS complained because the process have been waiting on the lockf for {0} sec with the error ({1}: {2}). Retrying. ".format(time.time() - start_time, e.errno, e.strerror))
f.close()
time.sleep(TIME_BETWEEN_ATTEMPTS)
f = open(*args, **kwargs)
no_attempt += 1
else:
raise e
Expand Down

0 comments on commit 35f008c

Please sign in to comment.