Skip to content

Commit

Permalink
Name variables in PostgresPersistDriver.get
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Mar 14, 2024
1 parent 55d7963 commit 48284ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/HummingbirdPostgres/PostgresPersistDriver.swift
Expand Up @@ -101,13 +101,13 @@ public final class PostgresPersistDriver: PersistDriver {
"SELECT data, expires FROM _hb_pg_persist WHERE id = \(key)",
logger: self.logger
)
guard let result = try await stream.decode((WrapperObject<Object>, Date).self)
guard let (object, expires) = try await stream.decode((WrapperObject<Object>, Date).self)
.first(where: { _ in true })
else {
return nil
}
guard result.1 > .now else { return nil }
return result.0.value
guard expires > .now else { return nil }
return object.value
}

/// Remove key
Expand Down

0 comments on commit 48284ce

Please sign in to comment.