Yesod - when should I use runDB and when should I use getDBRunner?


Yesod - when should I use runDB and when should I use getDBRunner?



I got a message when I tested mysql with mysqltuner which says that my mysql connections aren't being closed... I use a custom function I have created for every database interaction:


mysql


mysqltuner


runPoolDB :: YesodPersistRunner site => YesodDB site b -> HandlerT site IO b
runPoolDB action = do
((DBRunner runDB), done) <- getDBRunner
result <- runDB action
done
return result



Is it the problem? should I just change it to runPoolDB = runDB?


runPoolDB = runDB









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to input without newline? (Python)

C++ thread error: no type named ‘type’ MINGW

Analog for TagView in flutter