@@ -725,31 +725,30 @@ def _get_cache_life_span(cls):
725725 is used on every cache read
726726 """
727727
728- def __parse_life_span_string ():
728+ def __parse_life_span_string (life_span_str ):
729729 try :
730- return int (life_span_string )
730+ return int (life_span_str )
731731 except ValueError :
732732 try :
733- (d , h , m , s ) = TIME_RE .match (life_span_string ).groups ()
733+ (d , h , m , s ) = TIME_RE .match (life_span_str ).groups ()
734734 # time conversions in seconds
735735 times = [(s , 1 ), (m , 60 ), (h , 3600 ), (d , 86400 )]
736736 # sum the converted times
737737 # if not specified (None) use 0
738738 return sum (int (t [0 ] or 0 ) * t [1 ] for t in times )
739739 except Exception as e :
740- logger .error ("error parsing life_span_string %s" , life_span_string )
741- traceback .print_exc ()
740+ logger .error ("error parsing cache.life_span: %s" , life_span_str )
742741 # default 30 minutes in seconds
743742 return 1800
744743
745744 with cls ._LIFE_SPAN_LOCK :
746- life_span_string = get_setting ("cache.life_span" )
745+ life_span_str = get_setting ("cache.life_span" )
747746 try :
748- if cls ._PREV_LIFE_SPAN_STR == life_span_string :
747+ if cls ._PREV_LIFE_SPAN_STR == life_span_str :
749748 return cls ._PREV_LIFE_SPAN
750749 except AttributeError :
751750 pass
752751
753- cls ._PREV_LIFE_SPAN_STR = life_span_string
754- cls ._PREV_LIFE_SPAN = life_span = __parse_life_span_string ()
752+ cls ._PREV_LIFE_SPAN_STR = life_span_str
753+ cls ._PREV_LIFE_SPAN = life_span = __parse_life_span_string (life_span_str )
755754 return life_span
0 commit comments