CloudFlare has the same problem, but they pass along an additional header you
can use. Maybe Heroku can implement something like that.
--
You received this message because you are subscribed to the Google Groups
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To
Thanks Chris.
Sorry, it didn't work.
Here's my code:
if Time.now.thursday?
puts Send report
uri = URI.parse('http://myapp.heroku.com/messages/send_report')
Net::HTTP.get(uri)
puts Report put is done.
end
Here's the error output (after I ran heroku rake cron --trace)
**
if Time.now.wday == 1
# do something
end
On Thu, Mar 31, 2011 at 10:16 AM, Doug Naegele dougnaeg...@gmail.comwrote:
Can someone help me configure Heroku Cron to only run on a certain
day?
So, imagine I send an email report every Monday morning. How do I
write the syntax for that?
Try: Time.now.monday?
On Mar 31, 8:16 am, Doug Naegele dougnaeg...@gmail.com wrote:
Can someone help me configure Heroku Cron to only run on a certain
day?
So, imagine I send an email report every Monday morning. How do I
write the syntax for that?
Something like this:
This one works:
Hi Doug,
You might want to try www.simpleworker.com for this, you can just schedule
your job to run every monday at 7am.
eg:
class CallbackWorker SimpleWorker::Base
def run
HTTParty.get('http://myapp.heroku.com/messages/send_report')
end
end
Then schedule it with:
worker =
Oh, you must be on Ruby 1.8.7, then? You'll have Time#thursday? (and
the other days of the week) on 1.9, or if you're using Rails.
Sorry for the confusion. Jeff's suggestion is best, but when you
upgrade to 1.9 I'd suggest using Time#thursday?, since it's so much
more readable.
On Mar 31,
I had a similar problem with a Sinatra app on Rack. Rack's request.ip was
returning Amazon LB IPs. I ended up grabbing the client IP from the env
environment variables..
ip = env[‘HTTP_X_REAL_IP’] ||= env[‘REMOTE_ADDR’]
Hope that helps.
(