Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Django app #2663

Closed
wants to merge 8 commits into from
Closed

Async Django app #2663

wants to merge 8 commits into from

Commits on Jul 21, 2023

  1. Add ASGI Django app

    sarayourfriend committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    84c81d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    36d16fc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cd6e699 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1bbc1d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8d5dd60 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dd68ca2 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. Fix tests

    Now that we use pytest-asyncio, it is easier to test the dead links in an async context and not need to worry about weird issues with the aiohttp client session being used outside of an async context. The places where the function was being called before (only one, in search) can now call `sync_check_dead_links` instead without any change to the overall behaviour of the app. It just makes the tests easier to configure now that we actually have real async contexts going on in some places.
    sarayourfriend committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    0ed63f5 View commit details
    Browse the repository at this point in the history
  2. Try various things to fix the event loop closure, make a mess

    It is worth reverting the httpx addition back to the aiohttp version. Use the same implementation of `get_aiohttp_session` but actually use `aiohttp.ClientSession` instead. Pass `session.close` instead of `aclose` to the application shutdown callback. Everything else is basically the same. You will see the issues I have noted in the PR comment of the event loop closing if you replace the `web` service command in docker-compose with `gunicorn --reload`. The rest of the relevant configuration will get picked up from the gunicorn configuration file.
    sarayourfriend committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    980ef96 View commit details
    Browse the repository at this point in the history