Skip to content

Commit

Permalink
Removed events service.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMwangi21 committed Dec 10, 2024
1 parent 2d67c83 commit ce75d9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 72 deletions.
13 changes: 11 additions & 2 deletions server/planning/events/events_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ class EventsAsyncService(BasePlanningAsyncService[EventResourceModel]):
async def get_expired_items(
self, expiry_datetime: datetime, spiked_events_only: bool = False
) -> AsyncGenerator[list[dict[str, Any]], None]:
"""Get the expired items
"""
Retrieve "expired" events which are those whose end date is on or before `expiry_datetime` and
are not already marked as expired.
By default, items returned are:
- Not expired.
- Have an end date `<= expiry_datetime`.
If `spiked_events_only` is True, only spiked events are returned, still filtered by
end date `<= expiry_datetime`.
Where end date is in the past
Results are sorted by start date and fetched in batches.
"""
query: dict[str, Any] = {
"query": {
Expand Down
70 changes: 0 additions & 70 deletions server/planning/events/service.py

This file was deleted.

0 comments on commit ce75d9e

Please sign in to comment.