diff --git a/lib/logger/log_device.rb b/lib/logger/log_device.rb index e16f3b7..fdaa8cb 100644 --- a/lib/logger/log_device.rb +++ b/lib/logger/log_device.rb @@ -168,8 +168,9 @@ def check_shift_log else now = Time.now if now >= @next_rotate_time - @next_rotate_time = next_rotate_time(now, @shift_age) - lock_shift_log { shift_log_period(previous_period_end(now, @shift_age)) } + if lock_shift_log { shift_log_period(previous_period_end(now, @shift_age)) } + @next_rotate_time = next_rotate_time(now, @shift_age) + end end end end