Forums

PyTerrier - 504-loadbalancer error on POST requests

Hi! I have a suspicion it might be due to the fact that PyTerrier's underlying engine, "Terrier", is in Java and might use multiple threads.

Just to be sure though, I wanted to know why I keep getting 504 errors when making POST requests, could you help me?

I initialize PyTerrier when the app starts though, so it surprises me that whenever I perform a query via a POST request, it never answers. After 30 seconds, I get a 504 response.

You can do that processing asynchronously outside of your web app, then it doesn't matter if it starts threads: https://help.pythonanywhere.com/pages/AsyncInWebApps/