openfaas / cron-connector

Invoke functions on a schedule.
MIT License
39 stars 10 forks source link

Update cron package to v3 #12

Closed noam09 closed 3 years ago

noam09 commented 3 years ago

My actions before raising this issue

Expected Behaviour

Deploying a function with the following cron schedule annotation should be ignored by cron-connector since cron.Parse should return an error:

*/0 * * * *

Current Behavior

Deploying a function using the following specs:

arkade install cron-connector

faas-cli store deploy nodeinfo \
  --annotation topic="cron-function" \
  --annotation schedule="*/0 * * * *"

Causes cron-connector to freeze.

Possible Solution

Use robfig/cron v3 instead of v2: https://github.com/robfig/cron#upgrading-to-v3-june-2019

Steps to Reproduce (for bugs)

  1. Deploy OpenFaaS on Kubernetes
  2. arkade install cron-connector
  3. faas-cli store deploy nodeinfo \
     --annotation topic="cron-function" \
     --annotation schedule="*/0 * * * *"
  4. cron-connector Deployment's Pods freeze.
alexellis commented 3 years ago

Thank you for the issue. This looks like an invalid Cron expression, is that right?

If updating to v3 makes the component functionally better, do you want to run with this in a PR and get back to us after?

noam09 commented 3 years ago

Thank you for the issue. This looks like an invalid Cron expression, is that right?

Exactly.

If updating to v3 makes the component functionally better, do you want to run with this in a PR and get back to us after?

I'd be happy to take a look and see if it's something I can take on during my free time. I'll submit a PR if I think I have a working solution.

alexellis commented 3 years ago

Thanks. See how you go with it and let us know if you need help or have specific questions? We are available on Slack for Q&A.

alexellis commented 3 years ago

/msg: slack

derek[bot] commented 3 years ago

-- Join Slack to connect with the community https://docs.openfaas.com/community

alexellis commented 3 years ago

/set title: Update cron package to v3

alexellis commented 3 years ago

I've also pinged @viveksyngh to take a look at the upgrade to v3 of the cron package.