diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-07-10 19:58:43 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-07-10 19:58:43 -0700 |
commit | d734c714c1e7598ddba40b47c26d10f002e06420 (patch) | |
tree | f45f547500cc1bcb10a1fad4bb5af5213736c2e9 /bin | |
parent | c4e77b13c03d4d43b94b051cc819ff83a42f0ab5 (diff) | |
download | chef-d734c714c1e7598ddba40b47c26d10f002e06420.tar.gz |
Adding functional search support
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/chef-indexer | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/chef-indexer b/bin/chef-indexer index 0292002337..5ac363f58b 100755 --- a/bin/chef-indexer +++ b/bin/chef-indexer @@ -62,19 +62,22 @@ end # Get a Chef::SearchIndex object indexer = Chef::SearchIndex.new Chef::Queue.connect -Chef::Queue.subscribe(:queue, "node_index") -Chef::Queue.subscribe(:queue, "node_remove") +Chef::Queue.subscribe(:queue, "index") +Chef::Queue.subscribe(:queue, "remove") while 1 begin object, headers = Chef::Queue.receive_msg - if headers["destination"] =~ /index$/ + Chef::Log.info("Headers #{headers.inspect}") + if headers["destination"] == "/queue/chef/index" start_timer = Time.new indexer.add(object) + indexer.commit final_timer = Time.new Chef::Log.info("Indexed object from #{headers['destination']} in #{final_timer - start_timer} seconds") - elsif headers["destination"] =~ /remove$/ + elsif headers["destination"] == "/queue/chef/remove" start_timer = Time.new indexer.delete(object) + indexer.commit final_timer = Time.new Chef::Log.info("Removed object from #{headers['destination']} in #{final_timer - start_timer} seconds") end @@ -82,6 +85,6 @@ while 1 if e.kind_of?(Interrupt) raise e end - Chef::Log.error("Received Exception: #{e.to_str} continuing") + Chef::Log.error("Received Exception: #{e}\n#{e.backtrace.join("\n")} continuing") end end |