Conversation
Introduce _set_guild_locales_safe which wraps set_contextual_locales_from_guild with a 2s asyncio.wait_for timeout and catches exceptions, logging warnings and returning False on failure. Replace direct calls to set_contextual_locales_from_guild in several background loops with the safe wrapper and skip guilds where locale setup fails, preventing locale-related delays or errors from breaking background tasks.
Add concurrency limits and timeouts for background network work and hooks, and set HTTP client timeouts. Changes: - Introduced an asyncio.Semaphore and helper _run_background_io to bound concurrent background I/O (default 4). - Added _squawk_hook_timeout and wrapped squawk callback/pre-send/post-send hooks and channel sends with asyncio.wait_for to avoid blocking. - Refactored emergency squawk handling to build per-guild runtime state once per cycle (caches guild, channel, cooldown, last_alerts), enforce cooldowns, batch-update last_alerts only when dirty, and use _run_background_io for photo lookups and sends. - Reduced sleep between emergency checks and moved custom-alerts feed check to once per loop iteration; added dirty flag for custom_alerts to minimize writes. - Use _run_background_io for get_photo_by_aircraft_data and geofence/custom alert sends; ensure landed messages also use the same constrained send path. - APIManager: set aiohttp.ClientTimeout for the session, propagate timeout to ClientSession creation, and handle asyncio.TimeoutError in make_request (log/notify and update request stats). These changes prevent event-loop stalls under load, add resilience against slow external hooks/HTTP calls, and reduce redundant per-aircraft guild work.
Added star history section with dynamic chart.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| base = url.split("?", 1)[0].split("#", 1)[0] | ||
| if _is_image_filename(base): | ||
| return True | ||
| return "media.tenor.com" in url.lower() |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
No description provided.