add apprise and send notification when refreshing listings
This commit is contained in:
parent
ce386e748d
commit
762408e054
6 changed files with 105 additions and 6 deletions
|
|
@ -15,6 +15,7 @@ from dotenv import load_dotenv
|
|||
from fastapi import Depends, FastAPI, HTTPException, Query
|
||||
from api.auth import User
|
||||
from models.listing import QueryParameters
|
||||
from notifications import send_notification
|
||||
from rec import districts
|
||||
from redis_repository import RedisRepository
|
||||
from repositories.listing_repository import ListingRepository
|
||||
|
|
@ -82,6 +83,7 @@ async def refresh_listings(
|
|||
user: Annotated[User, Depends(get_current_user)],
|
||||
query_parameters: Annotated[QueryParameters, Query()],
|
||||
) -> dict[str, str]:
|
||||
await send_notification(f"{user.email} refreshing listings with query parameters {query_parameters.model_dump_json()}")
|
||||
# TODO: rate limit
|
||||
expiry_time = datetime.now() + timedelta(minutes=10)
|
||||
task = listing_tasks.dump_listings_task.apply_async(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue