Navigation Menu

Skip to content

Commit

Permalink
Don't exit by command implementation itself
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 15, 2015
1 parent cc1a1a4 commit 4a47f48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/droonga-engine-absorb-data
Expand Up @@ -47,7 +47,7 @@ module Droonga
succeeded = absorb

puts "Done." if succeeded
exit(succeeded)
succeeded
end

private
Expand Down Expand Up @@ -268,4 +268,4 @@ module Droonga
end
end

Droonga::AbsorbDataCommand.new.run
exit(Droonga::AbsorbDataCommand.new.run)
13 changes: 8 additions & 5 deletions bin/droonga-engine-join
Expand Up @@ -34,6 +34,9 @@ require "droonga/node_metadata"

module Droonga
class JoinCommand
class MissingRequiredParameter < StandardError
end

def run
@loop = Coolio::Loop.default

Expand All @@ -59,20 +62,20 @@ module Droonga
successed = copy_data
unless successed
do_cancel
exit(false)
return false
end
end
set_effective_message_timestamp
reset_source_node_role
reset_joining_node_role
puts("Done.")
true
rescue Exception => exception
puts("Unexpected exception: #{exception.message}")
puts(exception.backtrace.join("\n"))
do_cancel
exit(false)
false
end
exit(true)
end

private
Expand Down Expand Up @@ -121,7 +124,7 @@ module Droonga
@options = options
rescue Slop::MissingOptionError => error
$stderr.puts(error)
exit(false)
raise MissingRequiredParameter.new
end

def dataset
Expand Down Expand Up @@ -336,4 +339,4 @@ module Droonga
end
end

Droonga::JoinCommand.new.run
exit(Droonga::JoinCommand.new.run)

0 comments on commit 4a47f48

Please sign in to comment.