Skip to content

Commit

Permalink
it was not a bug, maybe i need testing
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed May 20, 2024
1 parent 63f9bc2 commit 39f9701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/repositories/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import logging_config

__all__ = ["logging_config"]

0 comments on commit 39f9701

Please sign in to comment.