config-cron-with-second
This commit is contained in:
parent
934b5a6fae
commit
1747b48b27
|
@ -24,7 +24,7 @@ type Scheduler struct {
|
||||||
// New ...
|
// New ...
|
||||||
func newSchedule(jobs ...*Job) *Scheduler {
|
func newSchedule(jobs ...*Job) *Scheduler {
|
||||||
l, _ := time.LoadLocation("Asia/Ho_Chi_Minh")
|
l, _ := time.LoadLocation("Asia/Ho_Chi_Minh")
|
||||||
c := cron.New(cron.WithLocation(l))
|
c := cron.New(cron.WithSeconds(), cron.WithLocation(l))
|
||||||
|
|
||||||
return &Scheduler{
|
return &Scheduler{
|
||||||
cron: c,
|
cron: c,
|
||||||
|
@ -47,7 +47,7 @@ func (s *Scheduler) startSchedule() {
|
||||||
func initSchedule() {
|
func initSchedule() {
|
||||||
jobs := []*Job{
|
jobs := []*Job{
|
||||||
{
|
{
|
||||||
Spec: "*/30 * * * * *",
|
Spec: "*/ * * * *",
|
||||||
Name: "Start job sync data to service appier",
|
Name: "Start job sync data to service appier",
|
||||||
Cmd: SyncToService{}.syncData,
|
Cmd: SyncToService{}.syncData,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue