dmwm/CRABServer — pull request #4608 by AndresTanasijczuk (2014-12-27 16:42:25+00:00)
Title: Improve situation with ASO view results in PostJob

This PR is to improve the situation described in issue https://github.com/dmwm/CRABServer/issues/4592
What I implemented is:
1) add a call to get_transfer_statuses() before starting the loop;
2) move sleep in ASO transfers monitoring loop to beginning of loop;
3) increase sleep time from 200 secs to 300 secs.
This is so that the couch view that is used to get the transfers statuses has some time to load itself before we use it to determine whether transfers are in a terminal state or not.
I also implemented a new wrapper function to load documents from couch which catches the exceptions that this process can raise.