Skip to content

Commit

Permalink
Merge branch 'master' of github.com:distribworks/dkron
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Jan 4, 2020
2 parents 88a4a5c + 95efe8a commit fa9c091
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions dkron/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/textproto"
"strings"
"text/template"
"time"

"github.com/jordan-wright/email"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -74,17 +75,17 @@ func (n *Notifier) buildTemplate(templ string) *bytes.Buffer {
Report string
JobName string
ReportingNode string
StartTime string
FinishedAt string
StartTime time.Time
FinishedAt time.Time
Success string
NodeName string
Output string
}{
n.report(),
n.Execution.JobName,
n.Config.NodeName,
fmt.Sprintf("%s", n.Execution.StartedAt),
fmt.Sprintf("%s", n.Execution.FinishedAt),
n.Execution.StartedAt,
n.Execution.FinishedAt,
fmt.Sprintf("%t", n.Execution.Success),
n.Execution.NodeName,
fmt.Sprintf("%s", n.Execution.Output),
Expand Down
4 changes: 2 additions & 2 deletions dkron/notifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ var templateTestCases = func(n *Notifier) []templateTestCase {
},
{
desc: "StartTime template variable",
exp: fmt.Sprintf("%s", n.Execution.StartedAt),
exp: n.Execution.StartedAt.String(),
template: "{{.StartTime}}",
},
{
desc: "FinishedAt template variable",
exp: fmt.Sprintf("%s", n.Execution.FinishedAt),
exp: n.Execution.FinishedAt.String(),
template: "{{.FinishedAt}}",
},
{
Expand Down

0 comments on commit fa9c091

Please sign in to comment.