
This should make the timeout logic clearer, without changing the logic at all. This does increase the timeouts, with the second pass using 1 minute instead of 30 seconds, and the third pass using 10 minutes instead of 1 minute. Since this often or usually runs in the background, it should allow some pretty long timeouts in the worst case.