Hello ACF people! Is there a way to create a sched...
# adobe
b
Hello ACF people! Is there a way to create a scheduled task in ACF that runs at an interval of less than one minute? I'm aware that Lucee can have scheduled tasks that run every 10 seconds. The ACF Administrator will only accept a minimum interval value of 1 minute. I read online that you can edit the ACF neo-cron.xml file and manually change the interval value for a given scheduled task, but there was also some debate as to whether or not this would work. Any guidance on this front would be appreciated!
r
why would you do this? Maybe a gateway/listener is a better option.
j
Hey @brianklaas you can create a task to run every few seconds in the admin. There is an option for seconds in the Daily Every option or you can use Crontime as well.
👍 1
And if you use the
cfschedule
tag you can enter the interval time which is in seconds and it will run even down to one second, which is not as limited as Lucee's 10 second minimum.
hmmm. I guess the limitation is on Standard, as I know in Enterprise it does work .... 👎
d
Also curious why?
j
@brianklaas just tested and there is a workaround in standard! Use the following value in the crontime option. That will execute every 5 seconds guaranteed, even on standard!
Copy code
0/5 * * ? * *
q
Brian -- any thoughts to converting it to an event gateway and have it just sit in an infinite loop? The task scheduler in ACF is unreliable, and you should expect it to not fire every 10 seconds if you are looking for consistency in that regard. If you need consistency and reliability you may need to look for an outside product to trigger events on a dedicated schedule. I've had to rely on a product like UC4 to trigger events that required reporting, etc.
e
On windows, create a task scheduler item, on linux use cron.
b
Thank you @jc, as always! To everyone else asking why: exploring ways to wait for a third-party API response that may take anywhere from 10-30 seconds and that lacks a webhook option. It's an exploration of the eternal question "How do you know that asynchronous work processed via a third-party is actually done when there is only a pull-based polling mechanism?" I could run the wait for the API to respond in a single CF request, but that means tying up resources. I may still go that route, especially since I used some Claude vibe coding to come up with a game for customers to play while they wait for the API response.
j
You're welcome @brianklaas!