Code Monkey home page Code Monkey logo

Comments (3)

mnitchie avatar mnitchie commented on July 19, 2024

Agree that this would be helpful! We've recently run in to boto/boto3#801

Our use case is that we are using django-health-check to ensure the app can connect to and has permissions for various aws services. These fail intermittently, and it took some spelunking into DHC internals to identify that it executes checks in threads.

A configuration option to add the ability to run checks without spawning threads would be most helpful. Thanks!

from django-health-check.

sevdog avatar sevdog commented on July 19, 2024

Maybe also having a "cleanup" method in BaseHealthCheckBackend which is called in the finally clause of BaseHealthCheckBackend.run_check method would be a good idea to address to this problem (since there may be elements which needs an explicit cleanup when using threads).

from django-health-check.

dimaqq avatar dimaqq commented on July 19, 2024

I'm interested in this too.
Actually, either disabling threads or passing the context would work in my use case.

To quote PEP-567:

executor = ThreadPoolExecutor()
current_context = contextvars.copy_context()

executor.submit(current_context.run, some_function)

from django-health-check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.