rails-exception_notification插件的问题

传送门:
[url]http://railsforum.com/viewtopic.php?id=35270[/url]

怎么解决这个问题呢?有什么好办法吗? :oops:

怎么异步,怎么新线程?怎么样不阻塞其它的request?怎么样就不会搞死我的web server?

当然首先我认为这是当初设计时引起的问题,但是现在除了不重构代码,怎么hack这个plugin来解决这个问题呢?

[color=green]================分割线=============================[/color]
根据下一站火星的看法,我决定不去考虑异步发信操作,新开ruby线程什么的。还是问题简单化。我决定不使用这个rails-exception_notification插件的发信操作了,我自己将500中的信息保存到数据库,然后再通过email定时来发送500邮件了。

小小的一点点hack这个异常处理的方法
    def rescue_action_in_public(exception)
case exception
when *self.class.exceptions_to_treat_as_404
render_404

else
render_500

deliverer = self.class.exception_data
data = case deliverer
when nil then {}
when Symbol then send(deliverer)
when Proc then deliverer.call(self)
end

#ExceptionNotifier.deliver_exception_notification(exception, self,
request, data)
# TODO:这样做
# SystemLog.create(".............................")
end
end
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值