首页 > 解决方案 > RunDeck 在重新尝试发送失败电子邮件的工作时会做什么?

问题描述

我想重试一个只有 1 个节点的工作。但是,除非 3 次重试失败,否则我不想发送错误。因此,如果失败少于此,则不会发送电子邮件。重试是否会为每次尝试发送失败电子邮件?

标签: emailrundeck

解决方案


是的,使用“在可重试失败时”通知结合在“重试”文本框中定义的重试(创建或编辑作业时转到“其他”选项卡),您会在每次重试尝试时收到一封电子邮件。

如果您在所有重试后想要一封电子邮件,只需按以下方式使用“失败时”通知(作业有一个故意错误来触发失败通知):

<joblist>
  <job>
    <defaultTab>nodes</defaultTab>
    <description></description>
    <executionEnabled>true</executionEnabled>
    <id>1bdda8f3-7b11-4003-9f6f-3480f6d08aac</id>
    <loglevel>INFO</loglevel>
    <name>HelloWorld</name>
    <nodeFilterEditable>false</nodeFilterEditable>
    <notification>
      <onfailure>
        <email attachType='file' recipients='it@example.net' subject='failure!' />
      </onfailure>
    </notification>
    <notifyAvgDurationThreshold />
    <plugins />
    <retry delay='2'>3</retry>
    <scheduleEnabled>true</scheduleEnabled>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <exec>eco "hi"</exec>
      </command>
    </sequence>
    <uuid>1bdda8f3-7b11-4003-9f6f-3480f6d08aac</uuid>
  </job>
</joblist>

推荐阅读