2

Im using the heroku-redis addon as a message broker for my django app, which is hosted on a VPS. The problem is that Heroku constantly change de URL of the service, so my app keep crashing from time to time, when the url is changed.

Anyone knows a way to fix this? Is there a way of getting automatically the updated URL for my heroku-redis addon?

benja d
  • 146
  • 1
  • 7

1 Answers1

2

From heroku-redis provisioning docs

In order for Heroku to manage this add-on for you and respond to a variety of operational situations, the REDIS config vars may change at any time. Relying on the config var outside of your Heroku app may result in you having to re-copy the value if it changes.

Just use REDIS_URL env variable in your settings to always get correct URL

iklinac
  • 14,944
  • 4
  • 28
  • 30
  • 2
    But my django app is hosted outside Heroku, so i cant access that variable directly. I know that one option might be to give access to my heroku cli to my vps, to get the variable, but doesnt seem like a good practice. – benja d Jun 03 '20 at 16:16
  • 1
    why do you use heroku redis if your app is not hosted there, you probably introduce lot of latency as cache is far from your VPS anyways ( you could install redis on vps). Unfortunately there is no watcher for link change, you can get private link on heroku-redis only when you spend 900$/month for private xD – iklinac Jun 03 '20 at 16:23