I'm in a situation where I need to monitor the sta...
# suitescript
d
I'm in a situation where I need to monitor the status of an 'external process' from NetSuite. Since the smallest measure of schedule is 15mins, has anyone done anything different to reduce that?
Perhaps a setTimeout() in a Scheduled script?
m
We have a process that runs every 5 minutes via a cron job that calls a php script that in turn calls a RESTlet. Even if you don't need it to run that frequently, that structure has the added benefit of not worrying about queues/processors being backed up and throwing off the frequency.
d
Thanks @MTNathan, ideally the solution should be pure NetSuite.
m
If it's not a regular thing and is instead triggered by some other process (i.e. you kick off some external process a few times a day and want to check on the status 5 minutes later), I can get behind that. If it's something that runs constantly all day though, I don't know that you're going to be able to solve that entirely within NetSuite, at least without dedicating an entire SuiteScript processor to the problem using something like that delay workaround you linked to.
d
Hmm, the more I think about it ... it should be a fairly simple and repeatable solution. Kick off a scheduled script, use the delay (while monitor executions and units). Respawn the scheduled script until the external process completes/fails. Shhh, don't tell NetSuite
m
As long as you're not concerned about bogging down a limited resource (i.e. SuiteScript processors) with waiting, that should technically work. I do wish that NetSuite had a better way to check in on something in a set amount of time without workarounds like this though. I guess you could create scheduled deployments on the fly like @alien4u has talked about before, that would be all native and (I believe) supported.
s
anything to avoid the abomination that is that example linked above would be preferable.
😂 1