From 39f97013151c6922520f00179cc424dd762c26c7 Mon Sep 17 00:00:00 2001 From: extreme4all <40169115+extreme4all@users.noreply.github.com> Date: Mon, 20 May 2024 19:41:31 +0200 Subject: [PATCH] it was not a bug, maybe i need testing --- src/app/repositories/report.py | 6 +++--- src/core/__init__.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 src/core/__init__.py diff --git a/src/app/repositories/report.py b/src/app/repositories/report.py index b5de935..2bd3e08 100644 --- a/src/app/repositories/report.py +++ b/src/app/repositories/report.py @@ -17,9 +17,9 @@ def _check_data_size(self, data: list[Detection]) -> list[Detection] | None: def _filter_valid_time(self, data: list[Detection]) -> list[Detection]: current_time = int(time.time()) - min_ts = current_time - 25200 - max_ts = current_time + 3600 - return [d for d in data if min_ts > d.ts > max_ts] + min_ts = current_time - 25200 # 7 hours ago + max_ts = current_time + 3600 # 1 hour in the future + return [d for d in data if min_ts < d.ts < max_ts] def _check_unique_reporter(self, data: list[Detection]) -> list[Detection] | None: return None if len(set(d.reporter for d in data)) > 1 else data diff --git a/src/core/__init__.py b/src/core/__init__.py new file mode 100644 index 0000000..dd10396 --- /dev/null +++ b/src/core/__init__.py @@ -0,0 +1,3 @@ +from . import logging_config + +__all__ = ["logging_config"]