Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 8ceb692

Browse files
Fix RedisDemo: update RedisKey
1 parent bb7f4e8 commit 8ceb692

File tree

2 files changed

+93
-4
lines changed

2 files changed

+93
-4
lines changed

Examples/RedisDemo/Package.resolved

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/RedisDemo/Sources/RedisDemo/main.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ let connection = try? RedisConnection.connect(
5252

5353
let syncCodableNIOLambda: SyncCodableNIOLambda<Event, Response> = { (event, context) throws -> EventLoopFuture<Response> in
5454

55-
guard let connection = connection else {
55+
guard let connection = connection,
56+
let key = RedisKey(rawValue: event.key) else {
5657
throw LambdaError.redisConnectionFailed
5758
}
5859

59-
let future = connection.set(event.key, to: event.value)
60-
.flatMap {
61-
return connection.get(event.key)
60+
let future = connection.set(key, to: event.value)
61+
.flatMap { _ in
62+
return connection.get(key)
6263
}
6364
.map { content -> Response in
6465
return Response(value: content ?? "")

0 commit comments

Comments
 (0)