heroku/heroku — pull request #163 by parolkar (2011-10-17 07:22:01+00:00)
Title: pgbackups:wait

Added 'heroku pgbackups:wait'. Its very useful where automated scripts need to ensure that all transfers are finished before proceeding.

People quite often write rake tasks(or automated scripts) to provision/restore db.
Its often seen that if there is a network error, heroku command pgbackups:restore die with exception ( very similar to this http://bit.ly/r5ZSAw or http://bit.ly/q84Eob) , this leaves transfers to keep running on heroku side, but client script never gets the info whether is finished finished.

Adding a new method to wait for transfers can fix this problem.

Usage:
#Restore db
begin
system("heroku pgbackups:restore ")
rescue
LOGGER.debug("Waiting for pgbackups related transfers to be over.")
system("heroku pgbackups:wait ")
end