You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to decrease the default values for timeoutIntervalForRequest and timeoutIntervalForResource of NSURLSessionConfiguration for every Alamofire remote calls in my iOS app since I don't want it to wait 60 seconds and 7 days respectively.
Changing the values of the configuration in a session that's already active has no effect. According to Apple's documentation on NSURLSession: Changing mutable values within the configuration object has no effect on the current session, but you can create a new session with the modified configuration object.
I suggest you create your manager instance and customize its configuration, as per our documentation.
before performing a request, as you can see from my question aswell. Maybe I made the mistake not to explain it any further in the question post but I can confirm you 100% I did not had any other Alamofire request opened and that was also the first performed in the app. So: what session could be active in this situation?.
I have also tried to place the configuration code in the didFinishLaunchingWithOptions func but it didn't work.
@jshier is absolutely correct here @giulio92. Your code will not end up doing anything. Instead, you need to do what @jshier suggested and either create a custom Manager instance, or set the values on each NSURLRequest you make, but then you won't be able to use the top-level APIs.
I am currently trying to decrease the default values for
timeoutIntervalForRequest
andtimeoutIntervalForResource
ofNSURLSessionConfiguration
for every Alamofire remote calls in my iOS app since I don't want it to wait 60 seconds and 7 days respectively.This is my code:
This is my log:
Timeline: { "Latency": 60.977 secs, "Request Duration": 60.977 secs, "Serialization Duration": 0.000 secs, "Total Duration": 60.977 secs }
As you can see the
Request Duration
value is over 30 seconds.Does this depends on the fact that I use
Alamofire.Manager.sharedInstance.request
instead ofAlamofire.request
?The text was updated successfully, but these errors were encountered: