From c74d3b3550c8360f072f56d7a85e8da59021c6ed Mon Sep 17 00:00:00 2001 From: codey Date: Tue, 3 Feb 2026 12:48:58 -0500 Subject: [PATCH] fix: update RateLimiter settings and load Discord webhook URL from environment --- endpoints/misc.py | 2 +- update_lrclib_db.py | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/endpoints/misc.py b/endpoints/misc.py index 6693a24..e4dc2c5 100644 --- a/endpoints/misc.py +++ b/endpoints/misc.py @@ -54,7 +54,7 @@ class Misc(FastAPI): handler, methods=["GET"], include_in_schema=True, - dependencies=[Depends(RateLimiter(times=10, seconds=2))], + dependencies=[Depends(RateLimiter(times=25, seconds=2))], ) app.add_api_route( diff --git a/update_lrclib_db.py b/update_lrclib_db.py index a0c129b..a7de59d 100644 --- a/update_lrclib_db.py +++ b/update_lrclib_db.py @@ -38,8 +38,8 @@ except ImportError: load_dotenv() -# Discord webhook for notifications -DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/1332864106750939168/6y6MgFhHLX0-BnL2M3hXnt2vJsue7Q2Duf_HjZenHNlNj7sxQr4lqxrPVJnJWf7KVAm2" +# Discord webhook for notifications (load from environment) +DISCORD_WEBHOOK_URL = os.getenv("DWH_URI", "") # Configuration - using environment variables 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) 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