It does not appear that Velo has methods/API for managing the backend/jobs.config file. Is there some fundamental reason that this capability has not been provided, or just a matter of priorities for Velo features?
The requirement I have is to programmatically add jobs or modify the cron settings for existing jobs in the jobs.config file-- say, by simply replacing the file with a new version–to accommodate events on the site (such as creation or revision of Pricing Plans that have corresponding cron-job requirements). Manually reconfiguring the jobs.config, in our case over numerous sites, is quite problematic.
If this proves to be a major hurdle with Wix jobs.config, is there an option to run backend functions in Wix using an npm package in Wix or an external 3rd-party cron-job manager (again, that would be modified by events on the Wix site)? If so, references to sources/explanations would be very much appreciated!
Thanks for replying! To clarify, the site event engenders the need for a new or altered ongoing job schedule. The backend function doesn’t operate ongoing schedules–right?–otherwise it would be job scheduler.
If there are not feasible options for programmatically managing jobs.config, an alternative being examined is to constrain the scheduling options that the site event invokes. So, instead of the event dictating a potentially unique schedule for a job, there is a set of scheduling options for that event (e.g., a new or revised Pricing Plan). One job (or a small set of jobs) in jobs.config is set to run on a schedule frequency that encompasses all the options, calling a “broker” backend function (as you suggest). The broker function selects the backend functions and parameters (e.g., Pricing Plan ID) that should be called at that time according to the scheduling option that is assigned (in this example) to the Pricing Plan.
Seem like a workable alternative? In our case, I believe a limited set of schedule options would be suitable. It also helps avoid problems with the 20-job limit in jobs.config.
Also, can you address my first question–why Velo doesn’t enable programmatic management of the jobs.config file?