FEATURE: add pop3 timeouts and auth errors to admin dashboard. Admins will get notified along with other problems.

This commit is contained in:
Neil Lalonde 2016-04-08 17:33:47 -04:00
parent 9c934e27be
commit 7f0b1691c4
3 changed files with 10 additions and 1 deletions

View file

@ -98,9 +98,11 @@ module Jobs
end end
rescue Net::OpenTimeout => e rescue Net::OpenTimeout => e
mark_as_errored! mark_as_errored!
AdminDashboardData.add_problem_message('dashboard.poll_pop3_timeout', SiteSetting.pop3_polling_period_mins.minutes + 5.minutes)
Discourse.handle_job_exception(e, error_context(@args, "Connecting to '#{SiteSetting.pop3_polling_host}' for polling emails.")) Discourse.handle_job_exception(e, error_context(@args, "Connecting to '#{SiteSetting.pop3_polling_host}' for polling emails."))
rescue Net::POPAuthenticationError => e rescue Net::POPAuthenticationError => e
mark_as_errored! mark_as_errored!
AdminDashboardData.add_problem_message('dashboard.poll_pop3_auth_error', SiteSetting.pop3_polling_period_mins.minutes + 5.minutes)
Discourse.handle_job_exception(e, error_context(@args, "Signing in to poll incoming emails.")) Discourse.handle_job_exception(e, error_context(@args, "Signing in to poll incoming emails."))
end end

View file

@ -83,7 +83,12 @@ class AdminDashboardData
def self.reset_problem_checks def self.reset_problem_checks
@problem_syms = [] @problem_syms = []
@problem_blocks = [] @problem_blocks = []
@problem_messages = ['dashboard.bad_favicon_url']
@problem_messages = [
'dashboard.bad_favicon_url',
'dashboard.poll_pop3_timeout',
'dashboard.poll_pop3_auth_error'
]
add_problem_check :rails_env_check, :ruby_version_check, :host_names_check, add_problem_check :rails_env_check, :ruby_version_check, :host_names_check,
:gc_checks, :ram_check, :google_oauth2_config_check, :gc_checks, :ram_check, :google_oauth2_config_check,

View file

@ -791,6 +791,8 @@ en:
one: "Email polling has generated an error in the past 24 hours. Look at <a href='/logs' target='_blank'>the logs</a> for more details." one: "Email polling has generated an error in the past 24 hours. Look at <a href='/logs' target='_blank'>the logs</a> for more details."
other: "Email polling has generated %{count} errors in the past 24 hours. Look at <a href='/logs' target='_blank'>the logs</a> for more details." other: "Email polling has generated %{count} errors in the past 24 hours. Look at <a href='/logs' target='_blank'>the logs</a> for more details."
bad_favicon_url: "The favicon is failing to load. Check your favicon_url setting in <a href='/admin/site_settings'>Site Settings</a>." bad_favicon_url: "The favicon is failing to load. Check your favicon_url setting in <a href='/admin/site_settings'>Site Settings</a>."
poll_pop3_timeout: "Connection to the POP3 server is timing out. Incoming email could not be retrieved. Please check your <a href='/admin/site_settings/category/email'>POP3 settings</a> and service provider."
poll_pop3_auth_error: "Connection to the POP3 server is failing with an authentication error. Please check your <a href='/admin/site_settings/category/email'>POP3 settings</a>."
site_settings: site_settings:
censored_words: "Words that will be automatically replaced with &#9632;&#9632;&#9632;&#9632;" censored_words: "Words that will be automatically replaced with &#9632;&#9632;&#9632;&#9632;"