base_pipeline.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:raw-data-repository 作者: all-of-us 项目源码 文件源码
def send_failure_alert(job_name, message, log_exc_info=False, extra_recipients=None):
  """Sends an alert email for a failed job."""
  subject = '%s failed in %s' % (job_name, app_identity.get_application_id())
  # This sender needs to be authorized per-environment in Email Authorized Senders,
  # see https://cloud.google.com/appengine/docs/standard/python/mail/.
  sender = config.getSetting(config.INTERNAL_STATUS_MAIL_SENDER)
  to_list = config.getSettingList(config.INTERNAL_STATUS_MAIL_RECIPIENTS)
  if extra_recipients is not None:
    to_list += extra_recipients
  logging.error(
      '%s: %s (email will be sent from %r to %r)',
      subject, message, sender, to_list, exc_info=log_exc_info)
  mail.send_mail(sender, to_list, subject, message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号