Fix retry being called multiple times for the same request.

Decoupled logger logic from download.