From b467096cd62c2fb9edd3ef35d15381375b9a8e9c Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Mon, 10 Feb 2020 12:13:47 -0800 Subject: [PATCH] Use latest version of Go for the builds - Required minor updates to the code. --- main.go | 2 +- runner.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 5e2d2ef..4d26c37 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( const ( Name = "go-crond" Author = "webdevops.io" - Version = "0.6.2" + Version = "0.6.3" LogPrefix = "go-crond: " ) diff --git a/runner.go b/runner.go index 84d6d31..920cb11 100644 --- a/runner.go +++ b/runner.go @@ -27,10 +27,10 @@ func NewRunner() *Runner { func (r *Runner) Add(cronjob CrontabEntry) error { cronSpec := cronjob.Spec if !strings.HasPrefix(cronjob.Spec, "@") { - cronSpec = fmt.Sprintf("0 %s", cronjob.Spec) + cronSpec = fmt.Sprintf("%s", cronjob.Spec) } - err := r.cron.AddFunc(cronSpec, r.cmdFunc(cronjob, func(execCmd *exec.Cmd) bool { + _, err := r.cron.AddFunc(cronSpec, r.cmdFunc(cronjob, func(execCmd *exec.Cmd) bool { // before exec callback LoggerInfo.CronjobExec(cronjob) return true @@ -50,10 +50,10 @@ func (r *Runner) AddWithUser(cronjob CrontabEntry) error { cronSpec := cronjob.Spec if !strings.HasPrefix(cronjob.Spec, "@") { - cronSpec = fmt.Sprintf("0 %s", cronjob.Spec) + cronSpec = fmt.Sprintf("%s", cronjob.Spec) } - err := r.cron.AddFunc(cronSpec, r.cmdFunc(cronjob, func(execCmd *exec.Cmd) bool { + _, err := r.cron.AddFunc(cronSpec, r.cmdFunc(cronjob, func(execCmd *exec.Cmd) bool { // before exec callback LoggerInfo.CronjobExec(cronjob)