mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Only retry 5 times to fetch box art
This commit is contained in:
committed by
Diego Waxemberg
parent
bed8c729f9
commit
d4b5ec5764
@@ -13,12 +13,14 @@
|
|||||||
#import "HttpRequest.h"
|
#import "HttpRequest.h"
|
||||||
|
|
||||||
@implementation AppAssetRetriever
|
@implementation AppAssetRetriever
|
||||||
static const double RETRY_DELAY = 1; // seconds
|
static const double RETRY_DELAY = 2; // seconds
|
||||||
|
static const int MAX_ATTEMPTS = 5;
|
||||||
|
|
||||||
|
|
||||||
- (void) main {
|
- (void) main {
|
||||||
UIImage* appImage = nil;
|
UIImage* appImage = nil;
|
||||||
while (![self isCancelled] && appImage == nil) {
|
int attempts = 0;
|
||||||
|
while (![self isCancelled] && appImage == nil && attempts++ < MAX_ATTEMPTS) {
|
||||||
if (self.useCache) {
|
if (self.useCache) {
|
||||||
@synchronized(self.cache) {
|
@synchronized(self.cache) {
|
||||||
UIImage* cachedImage = [self.cache objectForKey:self.app.appId];
|
UIImage* cachedImage = [self.cache objectForKey:self.app.appId];
|
||||||
|
|||||||
Reference in New Issue
Block a user