I have a web part that users use to initiate some processing which could take up to an hour to finish (it involves processing a lot of list items). If I start this processing on button click in standard server side code then obviously it times out. I am thinking of following options:
- Create an item in a new list with details of what to process and trigger a workflow on that list that will run in background. Workflow can keep updating the progress in list item that I can show on web part if user refreshes the page. Here the question is Can a workflow keep running for an hour or so? Is there any time limit or something else that can make it to stop?
- Trigger a timer job to do the same work. Again, any time limits for timer job
- Write a web service and invoke it from client side. I will get all list item Ids to process first and then invoke from JavaScript in batches and report progress on UI
Looking for pointers on how best to handle this kind of scenario and pros/cons of various approaches. Goals are:
- Reliably complete the processing even if it goes on for hours
- Ability to track progress of background work
- Preferably a way to stop and restart the process from where it was stopped
Thanks