-
Notifications
You must be signed in to change notification settings - Fork 10
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
HTTPX Timeout setting not synced w/ Orthanc setting #24
Comments
Hi @jrkerns , That's an excellent point, we should be able to change the timeout of a 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 = Orthanc('url', 'username', 'password')
orthanc.timeout = 300
modality = RemoteModality(orthanc, 'mymodality') |
Thanks, that's definitely easy. I ended up overriding
but I like your solution more. |
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! |
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! |
|
I'm not sure how many calls this might apply to, but when calling a C-MOVE from a remote modality, the timeout setting in the data dict appears to be just for Orthanc. HTTPX has it's own timeout default of 5s, so if the requested timeout is larger than that and the request does not resolve in 5s, an HTTPX timeout occurs. Using the C-MOVE in the readme as a start:
I'm working on a VPN w/ a slow connection, so the move command takes a while.
Without modification, this will always raise an HTTPX timeout, regardless of the timeout setting (since HTTPX is not being passed this setting). It seems like a relatively easy fix; something like:
here:
pyorthanc/pyorthanc/remote.py
Line 70 in 778b695
You'd need to adjust
post_modalities_id_query
andself._post
as well to handle the parameter, but this would at least make HTTPX use the same timeout as requested for Orthanc.When I adjusted this manually by removing the timeout (by adding
timeout=None
) the C-MOVE was successful given enough time.The text was updated successfully, but these errors were encountered: