Skip to content

Conversation

@LyricalNanoha
Copy link

Loading large images often times out. Add timeout handling for image requests.

static let normalResourceTimeout: TimeInterval = 60.0

/// 图片请求超时时间(秒)
static let imageRequestTimeout: TimeInterval = 60.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[imo]
It doesn't seem helpful for your situation since the default value is already 60.

The default value is 60.
https://developer.apple.com/documentation/foundation/urlsessionconfiguration/timeoutintervalforrequest

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default timeout is indeed set to 60 seconds. A configuration option for the image download timeout has been added, which can be dynamically adjusted based on your network conditions when you compile and install it yourself. I personally use 120 seconds, and this resolves the issue of image loading timeouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants