GithubHelp home page GithubHelp logo

Comments (5)

gacou54 avatar gacou54 commented on July 28, 2024 1

Hi @jrkerns ,

That's an excellent point, we should be able to change the timeout of a RemoteModality. I think it would be better if the Orthanc class had a timeout parameter, so every call made with the client instance would use the timeout. I actually plan to add all the httpx.Client parameters in the Orthanc.__init__() for the next release (hopefully next week). Then, this would work:

orthanc = Orthanc('url', 'username', 'password', timeout=300)
modality = RemoteModality(orthanc, 'mymodality')

# Now all orthanc and modality calls should have the 300 s timeout 

For now, this should do the trick since Orthanc inherited from httpx.Client:

orthanc = Orthanc('url', 'username', 'password')
orthanc.timeout = 300
modality = RemoteModality(orthanc, 'mymodality')

from pyorthanc.

gacou54 avatar gacou54 commented on July 28, 2024 1

Hi @Kiechlus,

PR #26 is ongoing, I hope to release the new pyorthanc version this week. In the meantime, this should work

orthanc = Orthanc('url', 'username', 'password')
orthanc.timeout = 300  # Set the timeout

# now use orthanc as you would ordinary
orthanc.get_patients()
...

Thank you for your interest to make pyorthanc better!

from pyorthanc.

jrkerns avatar jrkerns commented on July 28, 2024

Thanks, that's definitely easy. I ended up overriding .post :

class MyOrthanc(Orthanc):

   def post(*args, **kwargs):
        return super().post(*args, **kwargs, timeout=300)

but I like your solution more.

from pyorthanc.

Kiechlus avatar Kiechlus commented on July 28, 2024

I have the same problem, need to set the httpx timout because the default is much too short. Hope this will be released soon. Thanks a lot!

from pyorthanc.

gacou54 avatar gacou54 commented on July 28, 2024

timeout added in #26

from pyorthanc.

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.