MCPcopy Index your code
hub / github.com/DoNewsCode/core / ProvideCron

Method ProvideCron

cron/example_test.go:22–27  ·  view source on GitHub ↗
(crontab *cron.Cron)

Source from the content-addressed store, hash-verified

20}
21
22func (module *CronModule) ProvideCron(crontab *cron.Cron) {
23 crontab.Add("* * * * * *", func(ctx context.Context) error {
24 fmt.Println("I am a cron")
25 return nil
26 }, cron.WithMetrics(module.metrics), cron.WithName("foo"))
27}
28
29func Example() {
30 c := core.Default(core.WithInline("log.level", "none"))

Callers

nothing calls this directly

Calls 3

WithMetricsFunction · 0.92
WithNameFunction · 0.92
AddMethod · 0.45

Tested by

no test coverage detected