Changeset 294
- Timestamp:
- 12/16/07 20:44:21 (10 months ago)
- Files:
-
- trunk/plugin/acts_as_ferret/lib/ferret_server.rb (modified) (1 diff)
- trunk/plugin/acts_as_ferret/lib/server_manager.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugin/acts_as_ferret/lib/ferret_server.rb
r259 r294 70 70 71 71 ################################################################################ 72 # start the server 72 # start the server as a daemon process 73 73 def start 74 74 raise "ferret_server not configured for #{RAILS_ENV}" unless (@cfg.uri rescue nil) 75 platform_daemon { run_drb_service } 76 end 77 78 ################################################################################ 79 # run the server and block until it exits 80 def run 81 raise "ferret_server not configured for #{RAILS_ENV}" unless (@cfg.uri rescue nil) 82 run_drb_service 83 end 84 85 def run_drb_service 75 86 $stdout.puts("starting ferret server...") 76 77 platform_daemon do 78 self.class.running = true 79 DRb.start_service(@cfg.uri, self) 80 DRb.thread.join 81 end 87 self.class.running = true 88 DRb.start_service(@cfg.uri, self) 89 DRb.thread.join 82 90 rescue Exception => e 83 91 @logger.error(e.to_s) trunk/plugin/acts_as_ferret/lib/server_manager.rb
r292 r294 11 11 ################################################################################ 12 12 OptionParser.new do |optparser| 13 optparser.banner = "Usage: #{File.basename($0)} [options] {start|stop }"13 optparser.banner = "Usage: #{File.basename($0)} [options] {start|stop|run}" 14 14 15 15 optparser.on('-h', '--help', "This message") do … … 34 34 35 35 $ferret_server_action = $ferret_server_action.first 36 (puts optparser; exit(1)) unless %w(start stop ).include?($ferret_server_action)36 (puts optparser; exit(1)) unless %w(start stop run).include?($ferret_server_action) 37 37 end 38 38
