Documentation
¶
Index ¶
- type Crontab
- func (c *Crontab) AddFuncOneInstance(spec string, lockSec int, cmd func()) (cron.EntryID, error)
- func (c *Crontab) Cron() *cron.Cron
- func (c *Crontab) Init(redisClient *redis.Client, opts ...cron.Option) error
- func (c *Crontab) NewChain(w ...cron.JobWrapper) cron.Chain
- func (c *Crontab) OneInstanceCmd(name string, lockSec int, cmd func()) (func(), error)
- func (c *Crontab) Start()
- func (c *Crontab) Stop() context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crontab ¶
type Crontab struct {
// contains filtered or unexported fields
}
Crontab the warpper for cron.Cron, we can use it simply
TODO: if job doesn't complete timely, there will be a lot of go routines. We can do something for this.
func (*Crontab) AddFuncOneInstance ¶
AddFuncOneInstance add function which only run in an (vm) environment when triggered
if lockSec <= 0, we will set lockSec to default value: 60
func (*Crontab) NewChain ¶
func (c *Crontab) NewChain(w ...cron.JobWrapper) cron.Chain
NewChain warpper of cron.NewChain
func (*Crontab) OneInstanceCmd ¶
OneInstanceCmd construct a new cmd which only run in an (vm) environment when triggered
if lockSec <= 0, we will set lockSec to default value: 60 if some errors happened, it will return nil
Click to show internal directories.
Click to hide internal directories.