Skip to content

fixes for airport navid stuff#11

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

fixes for airport navid stuff#11
BenCos17 merged 57 commits into
backupfrom
main

Conversation

@BenCos17

Copy link
Copy Markdown
Owner

No description provided.

BenCos17 added 26 commits March 13, 2026 16:43
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()
@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33aee18e-3baf-44fa-9efc-5a67dcde3df2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main

Comment @coderabbitai help to get the list of available commands and usage tips.

@BenCos17 BenCos17 merged commit 31c49f5 into backup Apr 16, 2026
12 of 14 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