I have created a super simple rails app that takes a list of products, creates product records for each, hits a third-party API using the product ID and accordingly populates the respective product data from the response into each product record in the app.
It's perfectly fine locally with a list of up to a dozen products or more, all on the fly at run-time, so to speak. Images and all.
Additionally, I have added logging to show when the API call takes place and logs the raw XML response. Works fine locally.
I deploy to heroku and searching any ID, it breaks. The app throws what appears to be a 500 ("something went wrong") only to see later that the respective product objects have actually been created, though no product data was populated, nor was the API call ever made. (Literally, there is nothing logged, error or otherwise.)
Best practices aside, what I'm wondering is whether all third-party API calls on heroku need to be made from background jobs, or perhaps whether there's something else I'm missing.
I have implemented activejob too but still getting the same results. What could it be?
Thanks for your help.
All I needed to do was set my env variables with figaro.
Derp.
Thanks @Casper :)