HNY, everyone. I have a map/reduce script that se...
# suitescript
e
HNY, everyone. I have a map/reduce script that searches for customer payments to allocate. The search is implemented as a paged search (1000 records per page) that loops and accumulates the payments into an JS array during the input stage. The script works fine during weekdays but always times-out after 5 minutes during the weekend. 1) how can a paged-search time out? 2) is there some system task that could be running on weekends to block the search? Thanks.
k
you may share your script
c
Do you need to page the search in an M/R script? I'd be interested to see the structure of your search results. Executing the search yourself in the getInputData() stage is probably where you're going wrong. It's likely better to return the search and let the M/R script handle the execution.
e
Thanks for the suggestion. I can see what you are getting at but I'm reasonably confident the current structure is satisfactory. As I said earlier the script works fine during the week. It's only on the weekend the timeouts occur. I've checked the system script log around execution time but could not see any smoking gun.
c
I still think you should let NetSuite handle running the search. By forcing it, you're making it harder for the backend to mange resources. Unless there's a very clear reason for running the search explicitly, you should let it run implicitly as per M/Rs design. This will also give you simpler code. You're not losing much by trying and you might find the issue goes away.