remove tmp file when closing app with signal sigterm or sigint

This commit is contained in:
2021-10-27 15:07:23 +02:00
parent 6a8f01d064
commit 4a01c629ce
2 changed files with 29 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ class LogFileModel:
with self._lock:
# TODO handle lines longer than 4096 bytes
# TODO abort file open after a few secons: https://docs.python.org/3/library/signal.html#example
with open(self._file, 'rb') as f:
offset = min(byte_offset, self.byte_count())
offset = max(0, offset - self.settings.max_line_length())