#307·cron

Able to supply a name to a job

Author: jrouzierinverseCreated May 4, 2020Updated Dec 4, 2025

To improve debugging and logging allow Jobs to have a name. I would like to propose the following changes.

go
func (c *Cron)  AddFuncNamed(name string, spec string, cmd func()) EntryID {}
func (c *Cron)  AddJobNamed(name string, spec string, cmd Job) EntryID {}
func (c *Cron)  ScheduleNamed(name string, schedule Schedule, cmd Job) EntryID {}

If the name is empty. It will be set to the EntryID.

Would you mind if I send you a pull request for this?