Giter VIP home page Giter VIP logo

Comments (2)

BrunnerLivio avatar BrunnerLivio commented on May 22, 2024

We do not support a global timeout because it wouldn’t make sense in my eyes. Instead the timeout option can be given to individual health indicators as option.
The option parameter is usually the last parameter of a function.

For example the DNSHealthIndicator:

dns.pingCheck('google', 'https://google.com', { timeout: 800 })

The promiseTimeout is used for internal stuff, to extend promises with this timeout option, if it is not supported (e.g. DatabaseHealthIndicator uses it when running a SQL check).

I could extend the DNSHealthIndicator example so the users understands that the last parameter contains these kind of optional options. Would that be sufficient?

from terminus.

tomsquest avatar tomsquest commented on May 22, 2024

For the documentation problem, yes this would suffice.

But, about design:
Timeout should be the responsibility of the library, not the responsibility of the author of the healthcheck.
Any healtcheck should be timeout protected, and nest-terminus can bring that as the default. This means that developing a new HealthIndicator would only means implementing the actual call (db, smtp...).

from terminus.

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.