Aws-sdk-ios: AWSS3TransferUtilityTimeoutIntervalForResource configuration

Created on 25 Apr 2018  路  6Comments  路  Source: aws-amplify/aws-sdk-ios

I opened a similar issue several months ago, but it is closed due to inactivity. There i still no response for this:
Will there be a future possibility to customize the AWSS3TransferUtilityTimeoutIntervalForResource static property of AWSS3TransferUtility class? I cannot use any other service because only transfer utility uses background transfers, which I must implement.

Thank you!

feature request requesting info s3

Most helpful comment

Hello @nick3389

The latest version of the SDK, 2.6.20 released on 6/1/2018, contains this feature.

    let serviceConfiguration = AWSServiceManager.default().defaultServiceConfiguration
    let transferUtilityConfiguration = AWSS3TransferUtilityConfiguration()
    //Set the timeoutIntervalForResource parameter (in seconds)
    transferUtilityConfigurationWithRetry.timeoutIntervalForResource = 15*60 //15 minutes

    AWSS3TransferUtility.register(
        with: serviceConfiguration!,
        transferUtilityConfiguration: transferUtilityConfiguration,
        forKey: "custom-timeout"
    )

    //Instantiate the transfer utility
    let transferUtility = AWSS3TransferUtility.s3TransferUtility(forKey: "custom-timeout")

Let me know how it goes.

All 6 comments

Thank you @nick3389 for reporting to us. Sorry for the inconvenience caused. We are still tracking this as a feature request internally. I added the investigating tag so that the stale bot wouldn't close it.

Will you be able to use Static Credentials (Access and Secret Access Key) instead of Cognito Credentials? Static Credentials will not have this time limit and are valid till they are expired.

@kvasukib I already use static credentials, but as I can see from your code the time interval is used in createUploadTask for:

getPreSignedURLRequest.expires = [NSDate dateWithTimeIntervalSinceNow:AWSS3TransferUtilityTimeoutIntervalForResource];

@kvasukib Actually, if I understand correctly, you use this as the timeout of the request...

hello @nick3389

I am working on this request and will have an update soon for you on this thread.

@nick3389
I have made good progress on this request and am targeting the feature to be included in the next rev of the SDK

Hello @nick3389

The latest version of the SDK, 2.6.20 released on 6/1/2018, contains this feature.

    let serviceConfiguration = AWSServiceManager.default().defaultServiceConfiguration
    let transferUtilityConfiguration = AWSS3TransferUtilityConfiguration()
    //Set the timeoutIntervalForResource parameter (in seconds)
    transferUtilityConfigurationWithRetry.timeoutIntervalForResource = 15*60 //15 minutes

    AWSS3TransferUtility.register(
        with: serviceConfiguration!,
        transferUtilityConfiguration: transferUtilityConfiguration,
        forKey: "custom-timeout"
    )

    //Instantiate the transfer utility
    let transferUtility = AWSS3TransferUtility.s3TransferUtility(forKey: "custom-timeout")

Let me know how it goes.

Was this page helpful?
0 / 5 - 0 ratings