From 49083e59d822d963dffabadeec92387a7f93567f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 6 Jul 2007 09:15:04 +0000 Subject: unposted: improved calendar_lockfiles configuration --- Functions/Calendar/calendar_lockfiles | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Functions/Calendar') diff --git a/Functions/Calendar/calendar_lockfiles b/Functions/Calendar/calendar_lockfiles index 054b3f74b..93fbce060 100644 --- a/Functions/Calendar/calendar_lockfiles +++ b/Functions/Calendar/calendar_lockfiles @@ -3,13 +3,13 @@ local file lockfile msgdone # Number of attempts to lock a file. Probably not worth stylising. -integer lockattempts=3 loadtried +integer lockattempts=4 loadtried # The lockfile name is not stylised: it has to be a fixed # derivative of the main fail. for file; do lockfile=$file.lockfile - for (( i = 0; i < lockattempts; i++ )); do + for (( i = 0; i <= lockattempts; i++ )); do if ln -s $file $lockfile >/dev/null 2>&1; then lockfiles+=($lockfile) break @@ -24,10 +24,10 @@ for file; do fi if zmodload -e zsh/zselect; then # This gives us finer grained timing (100th second). - # Randomize the sleep between .1 and 1 second so that + # Randomize the sleep between .1 and 2 seconds so that # we are much less likely to have multiple instances # retrying at once. - zselect -t $(( 10 + RANDOM * 90 / 32768 )) + zselect -t $(( 10 + RANDOM * 190 / 32768 )) else sleep 1 fi -- cgit 1.4.1