fix: update RateLimiter settings and load Discord webhook URL from environment

This commit is contained in:
2026-02-03 12:48:58 -05:00
parent 277804d212
commit c74d3b3550
2 changed files with 3 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ class Misc(FastAPI):
handler, handler,
methods=["GET"], methods=["GET"],
include_in_schema=True, include_in_schema=True,
dependencies=[Depends(RateLimiter(times=10, seconds=2))], dependencies=[Depends(RateLimiter(times=25, seconds=2))],
) )
app.add_api_route( app.add_api_route(

View File

@@ -38,8 +38,8 @@ except ImportError:
load_dotenv() load_dotenv()
# Discord webhook for notifications # Discord webhook for notifications (load from environment)
DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/1332864106750939168/6y6MgFhHLX0-BnL2M3hXnt2vJsue7Q2Duf_HjZenHNlNj7sxQr4lqxrPVJnJWf7KVAm2" DISCORD_WEBHOOK_URL = os.getenv("DWH_URI", "")
# Configuration - using environment variables # Configuration - using environment variables
PG_CONFIG = { PG_CONFIG = {
@@ -496,13 +496,6 @@ async def fetch_latest_dump_info() -> Optional[Dict[str, Any]]:
dumps.sort(key=lambda x: parse_date_safe(x.get("date", datetime.min)), reverse=True) dumps.sort(key=lambda x: parse_date_safe(x.get("date", datetime.min)), reverse=True)
latest = dumps[0] latest = dumps[0]
# Handle type issue with strftime
if isinstance(latest["date"], datetime):
formatted_date = latest["date"].strftime("%Y-%m-%d %H:%M:%S")
else:
formatted_date = "Unknown date"
print(f"Latest dump: {latest['filename']} ({formatted_date})")
return latest return latest