Class: SystemControllerBase
- Inherits:
-
ApplicationControllerBase
- Object
- ActionController::Base
- ApplicationControllerBase
- SystemControllerBase
- Includes:
- ActionView::Helpers::DateHelper
- Defined in:
- lib/mrpin/controllers/system_controller_base.rb
Instance Method Summary collapse
- #cleanup_data ⇒ Object
- #download ⇒ Object
- #gc_stat ⇒ Object
- #generate_client_json ⇒ Object
- #info ⇒ Object
-
#initialize ⇒ SystemControllerBase
constructor
A new instance of SystemControllerBase.
- #invalidate_cache ⇒ Object
- #send_notifications ⇒ Object
Constructor Details
#initialize ⇒ SystemControllerBase
Returns a new instance of SystemControllerBase.
85 86 87 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 85 def initialize super end |
Instance Method Details
#cleanup_data ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 136 def cleanup_data result = nil begin result = get_response_ok(AppInfo.instance.cleanup_data) rescue Exception => e result = get_response_error(e) end render json: result end |
#download ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 149 def download begin url = get_url_for_download(params['type']) assert(!url.nil?, "url is not specified for param #{params['type']}") redirect_to(url) rescue Exception => e result = get_response_error(e) render json: result end end |
#gc_stat ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 68 def gc_stat result = nil begin result = get_response_ok(GC.stat) rescue Exception => e result = get_response_error(e) end render json: result end |
#generate_client_json ⇒ Object
189 190 191 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 189 def generate_client_json call_in_all_managers('generate_client_json') end |
#info ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 90 def info result = nil begin response = get_system_info result = get_response_ok(response) rescue Exception => e result = get_response_error(e) end render json: result end |
#invalidate_cache ⇒ Object
194 195 196 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 194 def invalidate_cache call_in_all_managers('invalidate_cache') end |
#send_notifications ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/mrpin/controllers/system_controller_base.rb', line 117 def send_notifications result = nil begin manager_notifications = AppInfo.instance.manager_notifications unless manager_notifications.nil? manager_notifications.send_notifications end result = get_response_ok rescue Exception => e result = get_response_error(e) end render json: result end |