34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/droonga/command/serf_event_handler.rb', line 34
def run
command_class = detect_command_class
return true if command_class.nil?
serf_name = ENV["SERF_SELF_NAME"]
command = command_class.new(serf_name, @payload)
begin
command.process if command.should_process?
rescue Exception => exception
command.log("Exception: #{exception.inspect}, #{exception.message}, #{exception.backtrace.join(", ")}")
raise exception
ensure
output_response(command.response)
end
true
rescue Exception => exception
begin
FileUtils.mkdir_p(Path.serf_event_handler_errors)
File.open(Path.serf_event_handler_error_file, "w") do |file|
file.write(exception.inspect)
file.write(exception.backtrace)
end
rescue Errno::EACCES => permission_denied_exception
end
puts exception.inspect
puts exception.backtrace
true
end
|