mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Add custom timeout setting for testing unreliable connection
This commit is contained in:
1 parent
2c95fa406a
commit
4eaedee9ab
1 file changed
+12
-1
Vendored
+12
-1
@@ -112,7 +112,18 @@
|
||||
_delegate = delegate;
|
||||
_inBackground = background;
|
||||
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
|
||||
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
|
||||
NSString *customTimeout = processInfo.environment[@"SPARKLE_TIMEOUT"];
|
||||
NSTimeInterval timeout;
|
||||
if (customTimeout != nil) {
|
||||
timeout = customTimeout.doubleValue;
|
||||
} else {
|
||||
timeout = 60.0;
|
||||
}
|
||||
|
||||
NSLog(@"SPARKLE_TIMEOUT: %f", timeout);
|
||||
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:timeout];
|
||||
|
||||
if (userAgent != nil) {
|
||||
[request setValue:(NSString * _Nonnull)userAgent forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
Reference in new issue
Block a user