Improve time handling for unexpected log messages
There are currently two deficiencies with the time handling for unrelated log messages which are not hindering basic usage but could be improved:
-
The time handling does advance when nothing is logged. This does not really happen for our systems but we should still have a timeout when reading from journalctl
to eventually flush any left-over messages. -
The time windows is always computed relative to the last time mail was sent, not the time when the oldest unexpected message was added to the buffer. This implies that if nothing unexpected happens for more than e.g. 15 minutes, the first unexpected message will be sent immediately instead of waiting until it is in the buffer for at most 15 minutes.