-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add getCronFromFrequency to manifest models #1325
base: master
Are you sure you want to change the base?
Conversation
9121f3d
to
0d8e7ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can now create daily, weekly and monthly triggers, with the randomness directly handled by the stack: https://github.com/cozy/cozy-stack/blob/master/docs/jobs.md#daily-syntax
I assume we could eventually directly use this? Although hourly is not supported yet (but should it?)
* | ||
* @param {import('../types').IOCozyKonnector} konnector - io.cozy.konnectors object | ||
* @param {Date} startDate - start date | ||
* @param {function} [randomDayTimeFn] - function generating random hours and minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth mentioning that the function requires 2 params, the minimal start hour and the max end hour, in the [0-24] interval? Which, I think, is a bit weird as it restricts the possibility to pass a custom function, but I don't know the use-case for this
This feature is imported from harvest and allows to get the cron string from a given frequency like 'daily'. This cron string will configure the trigger associated to the konnector
Oh I did not know that. Let's use it then |
I just saw that some some banking konnectors used by self hosted users use the "hourly" frequency (because the konnector is only run for them is their own machine I suppose). Maybe we should add the hourly frequency to the stack, what do you think ? |
@paultranvan It looks like hourly frequency is actually accepted but not documented But actually no, hourly is only implemented when the stack creates the trigger itself (when receiving a BI webhook for a non existing account/trigger) Adding @hourly trigger support should not be a lot work then |
Let's see cozy/cozy-stack#3835 |
@doubleface |
ping @doubleface |
@doubleface . If not needed anymore, please close. |
This feature is imported from harvest and allows to get the cron string
from a given frequency like 'daily'.
This cron string will configure the trigger associated to the konnector