Sha256: 3e574c45469814f29648f89458e266f3977fd7f561a5bfdea209c9db34890c61
Contents?: true
Size: 886 Bytes
Versions: 13
Compression:
Stored size: 886 Bytes
Contents
# encoding: utf-8 module XapianDb module IndexWriters # Worker to update the Xapian index; the worker is used in the beanstalk worker rake task # and uses the DirectWriter to do the real work # @author Gernot Kogler class BeanstalkWorker def index_task(options) klass = Kernel.const_get options[:class] obj = klass.respond_to?(:get) ? klass.get(options[:id].to_i) : klass.find(options[:id].to_i) DirectWriter.index obj end def unindex_task(options) klass = Kernel.const_get options[:class] obj = klass.respond_to?(:get) ? klass.get(options[:id].to_i) : klass.find(options[:id].to_i) DirectWriter.unindex obj end def reindex_class_task(options) klass = Kernel.const_get options[:class] DirectWriter.reindex_class klass, :verbose => false end end end end
Version data entries
13 entries across 13 versions & 1 rubygems