HangfireIO / Cronos

A fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions
MIT License
974 stars 114 forks source link

Minor request: Public variables for Hourly / Daily / Minutely #64

Closed tspence closed 6 months ago

tspence commented 6 months ago

A small request that might be easily satisfied - can the static readonly values on CronExpression.cs become public rather than private?

I noticed in my code that a common usage pattern was this:

        var scheduledTime = _configuration["AlertsScheduledJobsWorker:ScheduledTimeExpression"]
                            ?? "0 * * * *"; // By default run once per hour

I noticed this happens a half dozen times in our codebase, so I decided to replace 0 * * * * with a constant CronExpression.Hourly, and I decided to check if your library had one. It looks like those values already exist, but they are marked private. Would you accept a small PR to make these values public?

odinserj commented 6 months ago

Thanks, done!