config-cron-with-second #12

Merged
milano15662 merged 2 commits from develop into master 2022-03-25 07:27:49 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 1747b48b27 - Show all commits

View File

@ -24,7 +24,7 @@ type Scheduler struct {
// New ...
func newSchedule(jobs ...*Job) *Scheduler {
l, _ := time.LoadLocation("Asia/Ho_Chi_Minh")
c := cron.New(cron.WithLocation(l))
c := cron.New(cron.WithSeconds(), cron.WithLocation(l))
return &Scheduler{
cron: c,
@ -47,7 +47,7 @@ func (s *Scheduler) startSchedule() {
func initSchedule() {
jobs := []*Job{
{
Spec: "*/30 * * * * *",
Spec: "*/ * * * *",
Name: "Start job sync data to service appier",
Cmd: SyncToService{}.syncData,
},