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

Need a way to specify timeout for http connection which fetches external jsonld schema #268

Open
voiddrum opened this issue Jul 18, 2019 · 1 comment

Comments

@voiddrum
Copy link

As a result of debugging issue reported in #267 I faced another issue with the code taking considerable amount of time before it times-out the external connection. Need a way to specify the timeout setting to the external connection so that the code can fail fast if the developer wants it to.

@ansell
Copy link
Member

ansell commented Nov 27, 2019

The way to do this is to customise the DocumentLoader and/or the internal HttpClient instance. This is practically done by customising the JsonLdOptions object that you are using in this particular case with JsonLdOptions.setDocumentLoader, or JsonLdOptions.getDocumentLoader().setHttpClient():

https://github.com/jsonld-java/jsonld-java/blob/master/core/src/main/java/com/github/jsonldjava/core/JsonLdOptions.java#L289

https://github.com/jsonld-java/jsonld-java/blob/master/core/src/main/java/com/github/jsonldjava/core/DocumentLoader.java#L107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants