From ed4ddb00ed6f6bc577e627311bddf5325d56c873 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Sat, 22 Dec 2018 03:42:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9crontab=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E7=9A=84=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=AD=97=E7=AC=A6=20?= =?UTF-8?q?=E5=89=8D=E7=BC=80=20t,=20T=20->=20s,=20S=20=E4=BB=A3=E8=A1=A8S?= =?UTF-8?q?uccess,=20'=3F'=20->=20'>'=20=E4=BB=A3=E8=A1=A8=20=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E=E7=AD=89=E4=BA=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crontab_test.go | 2 +- interval_base.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crontab_test.go b/crontab_test.go index 78ce2f8..8a32427 100644 --- a/crontab_test.go +++ b/crontab_test.go @@ -79,7 +79,7 @@ func TestParseIntervalPlus(t *testing.T) { log.SetFlags(log.Llongfile) - crontab := "f2|f2?3|f3?4|1|t4?5" + crontab := "f2|f2>3|f3>4|1|s4>5" cron := NewCrontab(crontab) i := 0 diff --git a/interval_base.go b/interval_base.go index 2d65003..3512525 100644 --- a/interval_base.go +++ b/interval_base.go @@ -73,7 +73,7 @@ func parseIntervalString(crontab string) []interface{} { switch FN[0] { case 'f', 'F': - scharIndex := strings.Index(FN, "?") + scharIndex := strings.Index(FN, ">") if scharIndex != -1 { fc := FN[0:scharIndex] @@ -89,8 +89,8 @@ func parseIntervalString(crontab string) []interface{} { interval.PlanFail = append(interval.PlanFail, parseRandLR(fvalue)) } - case 't', 'T': - scharIndex := strings.Index(FN, "?") + case 's', 'S': + scharIndex := strings.Index(FN, ">") if scharIndex != -1 { tc := FN[0:scharIndex] tlr := FN[scharIndex+1:] @@ -106,8 +106,8 @@ func parseIntervalString(crontab string) []interface{} { } default: - FN = "t" + FN - scharIndex := strings.Index(FN, "?") + FN = "s" + FN + scharIndex := strings.Index(FN, ">") if scharIndex != -1 { tc := FN[0:scharIndex] tlr := FN[scharIndex+1:]