Skip to content

Commit

Permalink
Cleanup names
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Sep 13, 2023
1 parent 1548253 commit b5d705c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/Compute/Fastly/FastlyCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ extension Fastly.Cache {
var cacheHandle: WasiHandle = 0
let options: CacheWriteOptions = [.initialAgeNs, .staleWhileRevalidateNs, .length]
var config = CacheWriteConfig()
config.max_age_ns = .init(cachePolicy.ttl) * 1_000_000_000
config.stale_while_revalidate_ns = .init(cachePolicy.staleWhileRevalidate) * 1_000_000_000
config.max_age_ns = .init(cachePolicy.maxAge) * 1_000_000_000
config.stale_while_revalidate_ns = .init(cachePolicy.staleMaxAge) * 1_000_000_000
config.length = .init(length)
try wasi(fastly_cache__cache_transaction_insert_and_stream_back(handle, options.rawValue, &config, &bodyHandle, &cacheHandle))
return (.init(bodyHandle), .init(cacheHandle))
Expand Down
4 changes: 2 additions & 2 deletions Sources/Compute/Fastly/FastlyTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public enum CachePolicy: Sendable {
case pass
case ttl(_ seconds: Int, staleWhileRevalidate: Int = 0, pciCompliant: Bool = false)

public var ttl: Int {
public var maxAge: Int {
switch self {
case .origin:
return 0
Expand All @@ -414,7 +414,7 @@ public enum CachePolicy: Sendable {
}
}

public var staleWhileRevalidate: Int {
public var staleMaxAge: Int {
switch self {
case .origin:
return 0
Expand Down

0 comments on commit b5d705c

Please sign in to comment.