Re: [arch-dev-public] [PATCH 4/4] ftpdir-cleanup: lock repo before doing the cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Feb 24, 2010 at 8:52 PM, Evangelos Foutras <foutrelis@xxxxxxxxx> wrote:
> On Thu, Feb 25, 2010 at 3:36 AM, Eric Bélanger <snowmaniscool@xxxxxxxxx> wrote:
> <snip>
>>  for arch in ${ARCHES[@]}; do
>>
>> +  IS_LOCKED=0
>> +  count=0
>> +  while [ $count -le $LOCK_TRIAL ]; do
>> +    if repo_lock $reponame $arch ; then
>> +      IS_LOCKED=1
>> +      let count=$LOCK_TRIAL+1
>> +      continue
>
> I'd just use a 'break' here, instead of making the conditional
> expression false and jumping to the check again.

You're right. That's what I intended to do but I couldn't remember the
name of the command. ;)  I'll wait for other feedback before making a
new patch.

Also, for LOCK_TRIAL and LOCK_DELAY I chose what I believe is a sane
default, i.e. try every 10 seconds  for 1 minute.  These could be
tweaked of course.

BTW, I also removed some trailing spaces.  That's why some lines in
the patch don't appear to have any changes.

>
>> +    fi
>> +    sleep $LOCK_DELAY
>> +    let count=$count+1
>> +  done
>> +
>> +  if [ $IS_LOCKED -eq 0 ]; then
> <snip>
>
> Thanks for creating this patch. :)
>


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux