سؤال

Heroku Activity tracks release revisions of your application as v1, v2, etc. How can an application programmatically read its version? I have a single-page application using backbone, and would like to use a change in deployed version to automatically inform the backbone-based client that it should reload itself when the deployed server version changes.

هل كانت مفيدة؟

المحلول

There is currently no way to access the current revision on Heroku.

A slow workaround is to use the Heroku gem to fetch the version: https://stackoverflow.com/a/10973984/699304

You could fetch the current version async when starting the app and then cache it until the next deploy.
Let the clients poll for the version every minute, if it doesn't match the known one reload.

If they fetch it while you don't know count it as the same as the one they have to avoid excessive client reloads.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top