hibiken / asynq

Simple, reliable, and efficient distributed task queue in Go
MIT License
9k stars 659 forks source link

[FEATURE REQUEST] can add opt for cron to set second #894

Open kissIce opened 2 weeks ago

kissIce commented 2 weeks ago

Is your feature request related to a problem? Please describe. yes, my project want to set cron like The 50th second of every minute,but canot to finish it. because asynq no opt to set cron opt. it only can set min crontab express is minute,only a fixed interval second can be set。 not flexible

Describe the solution you'd like i want asynq can add opt or func to set cron opt, such as asynq have one func to set cron.WithSeconds() cron.WithParser()

kamikazechaser commented 1 week ago

like The 50th second of every minute

Well the official cronspec doens't support sub minute intervals. There are custom parsers that support this.

https://pkg.go.dev/github.com/robfig/cron/v3#hdr-Alternative_Formats

I'm not sure if we should default to this. At best, maybe allow replacing the parser.

HelloDing2333 commented 1 week ago

yes