cfg.add_argument(
'--lockfile_held_duration_warning_threshold_sec',
type=float,
- default=10.0,
+ default=60.0,
metavar='SECONDS',
help='If a lock is held for longer than this threshold we log a warning',
)
if self.locktime:
ts = datetime.datetime.now().timestamp()
duration = ts - self.locktime
- if (
- duration
- >= config.config['lockfile_held_duration_warning_threshold_sec']
- ):
+ if duration >= config.config['lockfile_held_duration_warning_threshold_sec']:
str_duration = datetime_utils.describe_duration_briefly(duration)
msg = f'Held {self.lockfile} for {str_duration}'
logger.warning(msg)