You can always use the Heroku gem to talk to the heroku infrastructure as the
CLI does.
For instance:
@heroku = Heroku::Client.new(ENV["HEROKU_EMAIL"], ENV["HEROKU_PASSWORD"])
You can then issue commands such as:
@heroku.restart('app_name')
Neil
On 15 Nov 2011, at 21:56, Corey Trager wrote:
> I have been doing the logs --tail.
>
> A little more info. My Heroku app screen scrapes another website.
> For reasons I don't understand, HTTP::Net.get_response sometimes
> results in EOFError and once that happens once, it happens always.
> It's as if somewhere deep in the ruby libs, there's some state that
> gets messed up and I don't know how to clear. Or maybe it's
> something in Heroku's infrastructure that's messed up that restarting
> clears. I don't know. Googling HTTP::Net and EOFError results in
> stories that are similar, but not exactly the same.
>
> I can try/rescue and catch the error, but that doesn't help clear that
> messed up state.
>
> I could run a cron job on my dev machine and issue "heroku restart"
> from there, but that's what I'm trying to avoid.
>
> On Nov 15, 2:18 pm, John McCaffrey <[email protected]> wrote:
>> I'm interested in that as well, but if the answer ends up being 'no',
>> perhaps your app could just capture the current state (eg. what caused it)
>> and send out an alert.
>>
>> when I've had problems in the past, I've been helped by
>> logging (logs --tail and the loggly add on)
>> new relic
>> exception notification
>> google analytics (see traffic patterns and urls)
>>
>> If you see the pattern and can fix it, you won't need to do the restart
>> business.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Nov 14, 2011 at 11:06 PM, Corey Trager <[email protected]> wrote:
>>> My app gets into a bad state for reasons I haven't figured out yet.
>>> So far, the only solution I've found is to issue a "heroku restart"
>>> command. The app itself can detect the bad state and so I'd like the
>>> app itself to issue the restart. Is that possible? It's a Sinatra
>>> app.
>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Heroku" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/heroku?hl=en.
>>
>> --
>> Thanks,
>> -John
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.