Team, question about Schedule Script (SS) deployme...
# suitescript
a
Team, question about Schedule Script (SS) deployments and parallel executions. I am triggering async integrations by calling a Scheduled Script, via the N/task module, from a User Event script (based on order statuses). The issue is that when there is already a deployment of the SS running, this error is shown: "Error: No available idle Script Deployments available for Script zzz". I think a work around is to create several deployments for the SS script and pass a null in the N/task call for the deployment. But this is a bit of a maintenance pain. Is this the right approach? Or is there a better way to have concurrent SS running?
b
your choices are to have multiple deployments and have your user events schedule an open deployment
or to have one deployment that processes multiple record
and just schedule that one deployment if its not already in the queue
your choice largely depends on how you want to handle errors
if fixing an error just means saving the record again, then having multiple deployments is sane
if you want a more automatic retry mechanism, then the one deployment makes more sense since you will already have logic to process multiple records
the only real mistake you make is if you have multiple deployments processing the same data
a
well, I call the SS only with one record as a parameter
so, it would only process one record
e
You can also catch the error and then duplicate (
record.copy
in code) the script deployment and submit the task again. (Solves manually having to create enough deployments)
a
this duplicate deployment would be saved? or is it just created on the fly?
my goal is to be able to run an unlimited number of SS at the same time, as there maybe many integration requests at the same time
b
more realistic goal is needed
a
well, not unlimited, but 10+ concurrent SS running?
b
if you wanted unlimited, then you need to make a new deployment for every record
e
that depends of course how long it takes the script to run
a
should not take long on a normal situation, builds a payload from a Sales Order and does an https.post
around 2-3 seconds normally
but trying to avoid getting the error
creating the deployment on the fly sounds great
188 Views