Class: BaseIndexer::AboutController

Inherits:
ApplicationController show all
Defined in:
app/controllers/base_indexer/about_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
# File 'app/controllers/base_indexer/about_controller.rb', line 4

def index
  render :text=>'ok', :status=>200
end

#versionObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/base_indexer/about_controller.rb', line 8

def version
  
  @result={:app_name=>Rails.configuration.app_name,:rails_env=>Rails.env,:version=>Rails.configuration.app_version,:last_restart=>(File.exists?('tmp/restart.txt') ? File.new('tmp/restart.txt').mtime : "n/a"),:last_deploy=>(File.exists?('REVISION') ? File.new('REVISION').mtime : "n/a")}
  @result.update({:solr_cores=>BaseIndexer.solr_configuration_class_name.constantize.instance.get_configuration_hash})
  
  respond_to do |format|
    format.json {render :json=>@result.to_json}
    format.xml {render :json=>@result.to_xml(:root => 'status')}
    format.html {render}
    # add the solr core names
  end      
  
end