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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.