alphagov/panopticon — pull request #170 by JordanHatch (2014-05-30 11:10:54+00:00)
Title: Retry fetching organisations for an artefact on timeout

In the `MainstreamOrganisationTagImporter`, rescue from a timeout when requesting needs by trying again.

This addresses a problem I'm seeing where, mid-way into the import run on preview, a timeout will cause the script to halt. This importer can be safely run multiple times over, but by adding the ability to automatically retry for a single artefact, this will save a significant amount of time in the case that a request does time out.

As this script is not being run unattended, I think it's alright that we don't limit the number of retries here, particularly because we're logging the retry to the console, so it would be obvious if an issue arose where the same artefact was being retried over and over again.