Skip to content

push all of main to backup branch #10

Merged
BenCos17 merged 57 commits into
backupfrom
main
Apr 7, 2026
Merged

push all of main to backup branch #10
BenCos17 merged 57 commits into
backupfrom
main

Conversation

@BenCos17

@BenCos17 BenCos17 commented Apr 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

BenCos17 added 27 commits March 13, 2026 16:38
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.
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

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()
@BenCos17 BenCos17 merged commit 5337db1 into backup Apr 7, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants