Can scripts be scheduled to execute ever 5 minutes...
# suitescript
a
Can scripts be scheduled to execute ever 5 minutes? Smallest frequency I have seen is 15minutes
s
nope, 15 minutes is the smallest increment. If you need near-real-time execution I usually recommend taking a different approach if possible. Another option is to use
N/task
to trigger a script exactly when needed.
Since scheduled and M/R scripts are intended for batch processing, it's often a design smell when we're trying to push them to be near-real-time.
a
Thanks. Could we deploy the script 3 times, and set it to execute every 15mins,? script 1 execute at 12:01; then ever 15mins script 1 execute at 12:06; then ever 15mins script 1 execute at 12:11; then ever 15mins
n
I think it's better to analyze your architecture here. What are you trying to do every 5 minutes?
a
Trying to Export Inventory levels which have changed in the last five minutes, to export to sFTP for website
n
I'd dump a file to the SFTP outbound folder each record update, then have your map/reduce with 2 deployments. Every time a file is created, try scheduling the map/reduce
your M/R should then be perpetually running or pending
total spitball ofc
quite frankly though, if this has to be realtime it should be realtime via an API call to your web side, not an SFTP patchfix. I'd tell them that it can't be realtime without that
🙌 1
a
@Nicholas Klug Great answer. I will push back to the third party devs
n
no problem! Good luck!
s
I'd agree - pushing an SFTP file is about as far removed from real-time techniques as you can get.
n
Any website worth its salt should have something you can push live data to. Hell, if it's as dumb as 3rd party engagements I've worked on are, they have something but it requires a tiny bit of work on their side to configure or they simply didn't think of mentioning it blob eyeroll
b
the desperate option is to have a scheduled script that continuously reschedules itself and then starts your "realtime" script every 5 minutes
you will essentially sacrifice one of queues/processors to accomplish this
more normal is to have middleware with better scheduling options use a restlet