func (cj *cronJob) Run(ctx context.Context) error {
	errChan := make(chan error, 1)
	go func() {
		cj.cron.AddFunc(cj.schedule, func() {
			errChan <- cj.fn()
		})
	}()

	for {

	}

	return nil
}
// Run a cronjob based on cron schedule.
// To cancle a job, pass the a context.
Run a cronjob based on cron schedule.
To cancle a job, pass the a context.
// Run a cronjob based on cron schedule . // To cancle a job pass the a context .
func (cj *cronJob) Run(ctx context.Context) error {
	errChan := make(chan error, 1)
	go func() {
		cj.cron.AddFunc(cj.schedule, func() {
			errChan <- cj.fn()
		})
	}()
	for {
	}
	return nil
}
func ( cj * cronJob ) Run ( ctx context . Context ) error { errChan := make ( chan error , 1 ) go func ( ) { cj . cron . AddFunc ( cj . schedule , func ( ) { errChan <- cj . fn ( ) } ) } ( ) for { } return nil }
Run a cronjob based on cron schedule.
Run a cronjob based on cron schedule .