diff --git a/borgweb/borg/models/repo.py b/borgweb/borg/models/repo.py index cd81672..14cb60a 100644 --- a/borgweb/borg/models/repo.py +++ b/borgweb/borg/models/repo.py @@ -74,10 +74,10 @@ class Repo(models.Model): size = self.size() return bytes_to_string(size) - def recent_errors(self, days: int = 7): + def recent_errors(self, days: int = 7, limit: int = 3): days_ago = (datetime.utcnow() - timedelta(days=days)) errors = self.label.errors.all().filter(time__gt=days_ago) - return errors + return errors[:limit] def get_archive_days(self, count: int = 31): current_day = datetime.utcnow().day