-
Notifications
You must be signed in to change notification settings - Fork 421
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
First Call from .Net core 2.1, subsequent request hangs #62
Comments
I am having the same problem. It can easily be reproduced in a console app as well, the second iteration in the loop below, the conversion will hang:
|
One possible workaround can be to instantiate a new
|
I spoke too soon.
What a mess this is. |
It seems to work for me after switching to the newest version of wkhtmltopdf (see also this PR) |
I upgraded to 0.12.5 of the 64-bit Windows library and it still hangs on the second request, so PR #59 didn't help me. However, I realized I was creating multiple instances of SynchronizedConverter, once I changed to a singleton then it actually works fine. |
This fixed the issue for me. Thanks! |
If someone still has this issue, can try to remove this 'var converter = new SynchronizedConverter(new PdfTools());' and just inject 'IConverter' in your service. I try and this approach is working, after all, we already register the converter, we don`t need to create an instance with 'new' keyword. |
I confirm too that changing to singleton instead of multiple instances works flawlessly. Thank you! |
When i call in the integration tests, in second test that calls convert i'm with same issue even follow the instructions and using singleton injection. Any tips? |
I would try version 0.12.5 above if you are not already. Then double check that you're calling |
Any luck with this? I experience the same issue. |
Hello,
I am working on ASP.NET Core v2.1.
I am able to generate PDF for the first time, but subsequent request hangs.
Please note, I've declare SynchronizedConverter as singleton in Startup.cs
Please suggest how to solve this issue.
The text was updated successfully, but these errors were encountered: