lib/generators/templates/beanstalk_worker in xapian_db-1.2.5.1 vs lib/generators/templates/beanstalk_worker in xapian_db-1.3
- old
+ new
@@ -3,11 +3,11 @@
require "bundler/setup"
require 'rails'
require 'daemons'
require "xapian_db"
-require 'yaml'
+require 'json'
require 'rails/railtie' # execute xapian_db railtie
# daemon script to manage the beanstalk worker daemon
# @author Gernot Kogler
module XapianDb
@@ -31,11 +31,11 @@
end
loop do
job = beanstalk.reserve
begin
- params = YAML::load job.body
+ params = JSON.parse(job.body).symbolize_keys!
Rails.logger.info "XapianDb beanstalk worker: executing task #{params}"
Rails.logger.flush
task = params.delete :task
worker.send task, params
Rails.logger.info "XapianDb beanstalk worker: done"
@@ -72,6 +72,6 @@
end
Dir.chdir dir
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
XapianDb::BeanstalkWorker.new.process_requests
-end
\ No newline at end of file
+end