Wheel Run Content Team
—Jul 22, 2022
Heroku Add-on goes off on August 8th, 2022. Hence we have to replace it with another service.
We decided to go with the Heroku Data For Redis.
We had to change the config/cable.yml file to reference the REDIS_URL
and not the REDIS_TO_GO_URL
.
# config/cable.yml
# ...
production:
adapter: any_cable
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: wheel_run_backend_api_production
After we created a PR and waited for the tests to run successfully, then we used the script:
$ ./bin/deploy.rb
to deploy to production.
Note: In the future, we might want to use Github actions to do the deployment.
We wanted to make sure that the application is not servicing any clients.
First the Ruby on Rails server:
$ heroku ps:scale web=0 worker=0 --app wheel-run-backend-api
Then, the AnyCable (WebSockets) Server
$ heroku ps:scale web=0 --app wheel-run-backend-api-ws
Then we removed the old add-on:
$ heroku addons:destroy <redis-go-to-add-on-name> --app wheel-run-backend-api
$ heroku addons:create heroku-redis:hobby-dev --ap wheel-run-backend-api
$ heroku addons:attach wheel-run-backend-api::REDIS --app wheel-run-backend-api-ws
On Ruby on Rails server app:
$ heroku ps:scale web=1 worker=1 --app wheel-run-backend-api
On AnyCable Web Sockets server app:
$ heroku ps:scale web=1 --app wheel-run-backend-api-ws
After everything has been restarted, we did some manual tests using the mobile app.
The migration to the Heroku Data for Redis add-on was quite easy, with minimum disruption in our case.