mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-02-17 17:04:49 +00:00
UX: Warn in /logs when PM is not sent (#271)
This commit is contained in:
parent
3dd5ad0f9c
commit
9bd70192b6
@ -116,7 +116,13 @@ after_initialize do
|
|||||||
DiscourseDataExplorer::ReportGenerator.new(automation.last_updated_by_id)
|
DiscourseDataExplorer::ReportGenerator.new(automation.last_updated_by_id)
|
||||||
report_pms = data_explorer_report.generate(query_id, query_params, recipients)
|
report_pms = data_explorer_report.generate(query_id, query_params, recipients)
|
||||||
|
|
||||||
report_pms.each { |pm| utils.send_pm(pm, automation_id: automation.id) }
|
report_pms.each do |pm|
|
||||||
|
begin
|
||||||
|
utils.send_pm(pm, automation_id: automation.id)
|
||||||
|
rescue ActiveRecord::RecordNotSaved => e
|
||||||
|
Rails.logger.warn "#{DiscourseDataExplorer::PLUGIN_NAME} - couldn't send PM for automation #{automation.id}: #{e.message}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user