-
Notifications
You must be signed in to change notification settings - Fork 32
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
Sending emails hangs when using RestRserve instead of plumber #206
Comments
@MislavSag I don't see the actual code, but my suspicion based on the |
Also be careful with Postgresql connections. Forks should not use single
connection concurrently. So you might need to create connection within
function which handles particular endpoint.
…On Sat, 24 Feb 2024, 06:53 Simon Urbanek, ***@***.***> wrote:
@MislavSag <https://github.com/MislavSag> I don't see the actual code,
but my suspicion based on the Docker file is that you may be using some
very convoluted way to send emails involving Java which is not possible if
you initialize the JVM too soon since you cannot fork a JVM. I would
recommend some more sane way to send email such as sendmail? If you
really want to use a JVM, make sure you start it only *after* the fork,
i.e. you must call .jinit() in the handler (but initializing an entire
JVM just to do something that it trivially done with a single command seems
a bit of an overkill...).
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHC5XLI5BA25FT3HJSSGRDYVEMYLAVCNFSM6AAAAABDWM5INCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGEYDIMBZGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I have changed email dependency package. Now I use blastula instead of mailR. Blastula has only pandoc as system requirement. It works now. So, you are right, it seems there was a problem with init JAVa on cores. But as I see now, sendemailR have minimal dependency, so I will try with it too. Blastula have huge dependency. @dselivanov , I am openeing and closing connection inside API function. It seems tome this is working as expected. |
Hi,
I have first developed plumber API, but wasn't happy with stability and speed.
I have rewritten API using RestRserve. Localy everything is working as expected, but when I create docker image, the hangs at email ntification (sending an email through mailR). I am not sure if this is in anyway connected to this package, but I don't know what to try, so I am posting here if you can find the reason.
Here is the app.R file:
and here is the Dockerfile:
Here are the logs when I execute set_holdings:
I would like to add that I could send an email while I was using plumbe, with same docker iamge. That is why I thinkg there could be some strange reason it doesn't work because of RestRserve.
The text was updated successfully, but these errors were encountered: