edgexfoundry / edgex-go

EdgeX Golang Services Monorepo | Owner: Core/Support WG
Apache License 2.0
1.35k stars 484 forks source link

Support seconds field in cron expression #4853

Closed jackchenjc closed 3 months ago

jackchenjc commented 3 months ago

πŸš€ Feature Request

Relevant Package [REQUIRED]

This feature request is for support-cron-scheduler. ### Description [**REQUIRED**] A more modern cron expression should support "seconds" as 6th field. ### Describe the solution you'd like Check if the given cron expression have "seconds" field, and attach `0` if not. For example: ``` 0 * * * * * ``` ### Describe alternatives you've considered

Should take the timezone into consideration. For example:

CRON_TZ=Asia/Taipei 0 * * * * *
jackchenjc commented 3 months ago

Found that the gocron lib we used has crontab validation implemented already. With withSeconds set to true here allows users specify crontab with seconds field, or the lib will attach 0 automatically if it is not specified.

Closing this issue.