Skip to content

Commit

Permalink
Merge pull request onevcat#1145 from FrainL/fix-immediately-expire
Browse files Browse the repository at this point in the history
Fix cache immediately expire when setting maxCachePeriodInSecond to negative
  • Loading branch information
onevcat authored Mar 27, 2019
2 parents 1699a82 + 162602a commit 47e1b86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/General/Deprecated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ extension ImageCache {
@available(*, deprecated, message: "Deprecated. Use `diskStorage.config.expiration` instead")
open var maxCachePeriodInSecond: TimeInterval {
get { return diskStorage.config.expiration.timeInterval }
set { diskStorage.config.expiration = .seconds(newValue) }
set { diskStorage.config.expiration = newValue > 0 ? .seconds(newValue) : .never }
}

@available(*, deprecated, message: "Use `Result` based callback instead.")
Expand Down

0 comments on commit 47e1b86

Please sign in to comment.