Change cron syntax to standard format (#2678)
* Change cron syntax to standard format * Add standard cron example in showschedule command Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
This commit is contained in:
+5
-2
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package timer
|
||||
|
||||
import (
|
||||
"github.com/robfig/cron"
|
||||
"github.com/robfig/cron/v3"
|
||||
"go.uber.org/zap"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -54,7 +54,10 @@ func MakeTimer(logger *zap.Logger, publisher publisher.Publisher) *Timer {
|
||||
}
|
||||
|
||||
func (timer *Timer) newCron(t fv1.TimeTrigger) *cron.Cron {
|
||||
c := cron.New()
|
||||
c := cron.New(
|
||||
cron.WithParser(
|
||||
cron.NewParser(
|
||||
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)))
|
||||
c.AddFunc(t.Spec.Cron, func() { //nolint: errCheck
|
||||
headers := map[string]string{
|
||||
"X-Fission-Timer-Name": t.Name,
|
||||
|
||||
Reference in New Issue
Block a user