I have multiple server actions which basically “syncs” an API of the software that we use, to our database. So all data from their API to our database. I want to run each sync on different time schedules, for instance sync1 every hour, and sync2 every 10 minutes. I can obviously achieve this using an action scheduler, but how can I fire an action scheduler (and change it’s interval) based on a database table like this:
Each row is should fire an action scheduler, which fires a server action every x minutes/hours. I’m not sure how to “link” the table rows to the scheduler. Any idea how to do this?
I’m just not sure what to use in the “your_dynamic_action” expression. Because the action scheduler should run a different server action, based on the row.
These are my server actions (in the folder sync):
"
And these are the server connect that run those server actions:
But I’m not sure how to dynamically bind those server connects to the dmx-on:tick ?
No, the action scheduler needs your page running open in your browser to execute the tasks. Once you close the page, it won't run.
I am afraid in the current action scheduler implementation it's only possible to call static server action names and dynamic ones (what you need here) are not supported.
If you have full control of your server you can create a page or app than runs action scheduler. Of Course the page or app needs to be open and running all the time.