On Heroku, using Ruby on Rails, I want to identify individual web servers

When an application on Heroku is restarted, I would like to run some set-up tasks. However, I only want them to be run once.

If I put the tasks in an initializer and I have multiple web dynos set up, every dyno will run the task.

Is it possible to identify individual web dynos, and perhaps which is the first to spin up?

Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.