This repository was archived by the owner on Apr 18, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed
MSGraphClientSDK/MSGraphClientSDK/Middleware/Options Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,12 @@ @implementation MSRedirectHandlerOptions
1212
1313- (instancetype )init
1414{
15- self = [super init ];
16- if (self)
17- {
18- _maxRedirects = 5 ;
19- middlewareOptionsType = MSMiddlewareOptionsTypeRedirect;
20- }
21- return self;
15+ return [self initWithMaxRedirects: 5 andError: nil ];
2216}
2317
2418- (instancetype )initWithMaxRedirects : (NSInteger )maxRedirects andError : (NSError *__autoreleasing *)error
2519{
26- self = [self init ];
20+ self = [super init ];
2721 if (self)
2822 {
2923 if (maxRedirects>UPPER_LIMIT_FOR_REDIRECTS)
@@ -36,6 +30,7 @@ - (instancetype)initWithMaxRedirects:(NSInteger)maxRedirects andError:(NSError *
3630 return nil ;
3731 }
3832 _maxRedirects = maxRedirects;
33+ middlewareOptionsType = MSMiddlewareOptionsTypeRedirect;
3934 }
4035 return self;
4136}
Original file line number Diff line number Diff line change @@ -14,19 +14,12 @@ @implementation MSRetryHandlerOptions
1414
1515- (instancetype )init
1616{
17- self = [super init ];
18- if (self)
19- {
20- _delay = 3 ;
21- _maxRetries = 3 ;
22- middlewareOptionsType = MSMiddlewareOptionsTypeRetry;
23- }
24- return self;
17+ return [self initWithDelay: 3 maxRetries: 3 andError: nil ];
2518}
2619
2720- (instancetype )initWithDelay : (NSInteger )delay maxRetries : (NSInteger )maxRetries andError : (NSError *__autoreleasing *)error
2821{
29- self = [self init ];
22+ self = [super init ];
3023 if (self)
3124 {
3225 if (delay>UPPER_LIMIT_FOR_DELAY)
@@ -50,6 +43,7 @@ - (instancetype)initWithDelay:(NSInteger)delay maxRetries:(NSInteger)maxRetries
5043 }
5144 _delay = delay;
5245 _maxRetries = maxRetries;
46+ middlewareOptionsType = MSMiddlewareOptionsTypeRetry;
5347 }
5448 return self;
5549}
You can’t perform that action at this time.
0 commit comments