diff --git a/crontab.go b/crontab.go index 7d7a424..164a776 100644 --- a/crontab.go +++ b/crontab.go @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/satori/go.uuid" + "474420502.top/eson/structure/circular_linked" "github.com/Pallinder/go-randomdata" @@ -42,6 +44,7 @@ func (force *Force) NextTime() time.Time { type Crontab struct { crontab string + uid uuid.UUID force *Force min []timePointer @@ -166,6 +169,12 @@ func (cron *Crontab) String() string { func (cron *Crontab) FromString(crontab string) error { crontab = cron.crontab + uid, err := uuid.NewV4() + if err != nil { + panic(err) + } + cron.uid = uid + cron.interval = nil cron.min = nil cron.hour = nil @@ -295,7 +304,7 @@ func (cron *Crontab) intervalCalculateNextTime(now time.Time) { } - log.Println("success:", cron.trueCount, "count time wait:", isecond, "s") + fmt.Println(cron.uid.String(), "success:", cron.trueCount, " wait:", isecond) } else { @@ -313,7 +322,7 @@ func (cron *Crontab) intervalCalculateNextTime(now time.Time) { } } - log.Println("fail:", cron.failCount, "count time wait:", isecond, "s") + fmt.Println(cron.uid.String(), "fail:", cron.failCount, " wait:", isecond) } iv.Count--