smtp - Sending email with Flask errors with SMTPHandler -


i saw in documentation extremely easy way send emails on flask errors. question whether considerably affect performance of app? in, process running app sending email?

my current hunch because smtp server running on process, enqueue email , send when can, meaning won't affect performance of app.

well, smtphandler inherits logging.handler. looking @ logging.handler, while several things handle being called in multiple threads doesn't spawn multiple threads. logging calls happen in thread called on. so, if reading code correctly, logging call block thread running on until completes (which means if smtp server takes 30 seconds respond erroring thread take time_to_error + 30 seconds + time_to_send + time_to_respond_to_request_with_500.)

that said, mis-reading code. however, you'd better off using sysloghandler , letting syslog handle sending messages out of band.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -