Skip to content

Commit

Permalink
Force retry of failed downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
eliog authored and Olivier Poitrey committed Jan 25, 2011
1 parent 20b8cdf commit ee153fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions SDWebImageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
+ (id)sharedManager;
- (UIImage *)imageWithURL:(NSURL *)url;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed;
- (void)cancelForDelegate:(id<SDWebImageManagerDelegate>)delegate;

@end
7 changes: 6 additions & 1 deletion SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ - (UIImage *)imageWithURL:(NSURL *)url

- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate
{
if (!url || !delegate || [failedURLs containsObject:url])
[self downloadWithURL: url delegate:delegate retryFailed:NO];
}

- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed
{
if (!url || !delegate || (!retryFailed && [failedURLs containsObject:url]))
{
return;
}
Expand Down

0 comments on commit ee153fe

Please sign in to comment.