Use strings consistently for database/api/gpx status
This commit is contained in:
parent
591abd4358
commit
cba7945a5b
1 changed files with 9 additions and 9 deletions
|
@ -147,14 +147,14 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_api_readable
|
def check_api_readable
|
||||||
if api_status == :offline
|
if api_status == "offline"
|
||||||
report_error "Database offline for maintenance", :service_unavailable
|
report_error "Database offline for maintenance", :service_unavailable
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_api_writable
|
def check_api_writable
|
||||||
unless api_status == :online
|
unless api_status == "online"
|
||||||
report_error "Database offline for maintenance", :service_unavailable
|
report_error "Database offline for maintenance", :service_unavailable
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
@ -162,21 +162,21 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
def database_status
|
def database_status
|
||||||
if Settings.status == "database_offline"
|
if Settings.status == "database_offline"
|
||||||
:offline
|
"offline"
|
||||||
elsif Settings.status == "database_readonly"
|
elsif Settings.status == "database_readonly"
|
||||||
:readonly
|
"readonly"
|
||||||
else
|
else
|
||||||
:online
|
"online"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def api_status
|
def api_status
|
||||||
status = database_status
|
status = database_status
|
||||||
if status == :online
|
if status == "online"
|
||||||
if Settings.status == "api_offline"
|
if Settings.status == "api_offline"
|
||||||
status = :offline
|
status = "offline"
|
||||||
elsif Settings.status == "api_readonly"
|
elsif Settings.status == "api_readonly"
|
||||||
status = :readonly
|
status = "readonly"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
status
|
status
|
||||||
|
@ -184,7 +184,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
def gpx_status
|
def gpx_status
|
||||||
status = database_status
|
status = database_status
|
||||||
status = :offline if status == :online && Settings.status == "gpx_offline"
|
status = "offline" if status == "online" && Settings.status == "gpx_offline"
|
||||||
status
|
status
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue