there might be a better way to do this, but I found that starting a
new stack (like rake tasks or script/runner) takes a long time.

what I did in an app that processes a lot of emails, was make a
maintenance controller that triggered methods for cronlike jobs.  then
just call it with a wget in cron and drop the output.

originally, I was calling script/runner for every incoming email which
was ugly at 5-10 seconds per start.  even with a cron job checking for
new emails to process it was tying up too much processor time.  it's a
moderate server for an internal app that really have no way to scale
hardware up.

obviously, this approach only works for things that can't be abused
(open security holes, DOS attacks, etc.).  so no parameters, no info
return.

On Apr 27, 12:18 pm, MichelV69 <[email protected]> wrote:
> Heya, folks.
>
> I've got a rake task that runs via CRON.  In it, I generate emails for
> users.  I added my status_report() method to UserMailer.  However,
> when I fire the Rake task, I get:
>
> rake aborted!
> undefined method `request' for nil:NilClass
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/whiny_nil.rb:52:in `method_missing'
> /usr/local/lib/ruby/gems/1.8/gems/hobo-1.0.0/lib/hobo/controller.rb:
> 37:in `request_host'
>
> ... this would correspond to the "Hobo::Controller.request_host"
> statement which I lifted from the forgot_password() method already in
> UserMailer.  For the short term, I can hard-code the host name in and
> continue my work.  What I am wondering is if there is an easy way to
> bring Hobo "stuff" into a Rake task.  A simple "include
> 'Hobo::Controller'" in my Rake task didn't do the job.
>
> Thanks all!
>
> Regards,
>   --Michel
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" 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 
> athttp://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to