add config
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
package job
|
||||
|
||||
import (
|
||||
"github.com/robfig/cron/v3"
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
// InitializeJobs
|
||||
// Initializes Dependency Injection modules and registers controllers
|
||||
// Initializes Dependency Injection modules and registers jobs
|
||||
//
|
||||
// Args:
|
||||
// *dig.Container: Dig Container
|
||||
func InitializeJobs(c *dig.Container) {
|
||||
err := c.Invoke(NewConcertJob)
|
||||
if err != nil {
|
||||
panic("unable to initialize concert controller")
|
||||
panic("unable to initialize concert job")
|
||||
}
|
||||
c.Invoke(func(cr *cron.Cron) {
|
||||
cr.Start()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user