Ignore:
Timestamp:
09/03/15 17:12:53 (9 years ago)
Author:
sdipsl
Message:
  • catch the status of the stat command. It led to silent failure when the filesystem suffers some glitch. See #264
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1231 r1234  
    128128  typeset buffer send_messages mail_frequency 
    129129  typeset last_mail_date__file 
     130  typeset secondsBetweenRefAndLastMail secondsSinceLastMail 
    130131 
    131132  b64_encoded_msg=$1 
     
    148149  else 
    149150    # compute last time the file was changed (in seconds) 
    150     seconds_since_last_mail=$(( $(date +%s) - $(stat -c %Y ${last_mail_date__file}) )) 
     151    secondsBetweenRefAndLastMail=$(stat -c %Y ${last_mail_date__file}) 
     152    status=$? 
     153    # 
     154    if [ ${status} -gt 0 ] ; then 
     155      IGCM_debug_Exit "IGCM_debug_send_AMQP_msg__MAILTUNNEL" 
     156    fi 
     157    secondsSinceLastMail=$(( $(date +%s) - ${secondsBetweenRefAndLastMail} )) 
    151158    # send message when exceeding threshold 
    152     [ ${seconds_since_last_mail} -gt ${mail_frequency} ] && send_messages=1 
     159    [ ${secondsSinceLastMail} -gt ${mail_frequency} ] && send_messages=1 
    153160  fi 
    154161 
Note: See TracChangeset for help on using the changeset viewer.