Let me take a wild guess on this one.
On ACTS_AS_FERRET_GEM_ROOT/lib/index.rb
def ferret_create
if ferret_enabled?
logger.debug "ferret_create/update: #{self.class.name} : #{self.id}"
self.class.aaf_index << self
else
ferret_enable if @ferret_disabled == :once
end
true # signal success to AR
end
Try wrapping "aaf_index<<" like this
begin
self.class.aaf_index << self
rescue Exception => e
logger.warn "Error creating/updating document:
#{e.inspect}\n#{e.backtrace.join("\n\t")}"
end
Mind I'm just reading the source and writing the code here straight
away. In the event of my theory being right, this would gracefully
handle exceptions related to adding an entry to the index by dropping
a warning in the AAF log file and moving on.
I think this could be an optional in config/initializers (Rails 2.0)
perhaps, as in
config.aaf.exception_on_save = true
IMHO, of course.
On Nov 12, 2007 8:36 AM, Benjamin Krause <[EMAIL PROTECTED]> wrote:
> Hey ..
>
> unfortunately, no .. not with the current construction.
> However, there might be a chance to switch to a
> messaging service like ap4r, so your indexing
> requests doesn't get lost.
>
> I think there are some considerations about re-factoring
> the drb server, so maybe this dependency might be
> dropped in the future..
>
> Cheers
> Ben
>
>
>
>
>
>
> On 2007-11-11, at 16:09, Morten wrote:
>
> Hi.
>
> We use FerretDrb for search. If the ferret process is down, our entire
> application comes down the moment we try to save a model which is indexed.
>
> Is there a way to decouple this relationship such that we can somehow
> resume normal operations despite ferret being down and not index the model?
>
> Thanks.
>
> Morten
>
>
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
>
>
> Gruss
> Ben
> ---
> Benjamin Krause
> http://www.omdb.org/
> [EMAIL PROTECTED]
>
> Rails-Schulung "Advancing with Rails" mit David A. Black
> 19.11.-22.11.2007, Berlin-Mitte
> Details u. Anmeldung: http://www.railsschulung.de
>
>
>
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk