Skip to content

Commit

Permalink
try to install redis
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso committed Nov 8, 2024
1 parent 7d0a0b8 commit e06f314
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ changelog:
- title: 🚨🚨🚨 Missing Labels - Add labels to the prs listed here and generate the release notes again
labels:
- "*"

2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
# since we don't have systemctl, we run the redis server manually in the background
linux_pre_build_command: apt-get update -y && apt-get install redis
linux_pre_build_command: apt-get update -y && apt-get install redis -y
linux_env_vars: REDIS_URL=redis
linux_build_command: bash -c 'redis-server &; swift test'
enable_windows_checks: false
9 changes: 6 additions & 3 deletions Sources/RediStack/ChannelHandlers/RedisPubSubHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,14 @@ extension RedisPubSubHandler {
guard
let latestSubscriptionCount = results
.lazy
.reversed() // reverse to save time-complexity, as we just need the last (first) successful value
// reverse to save time-complexity,
// as we just need the last (first) successful value
.reversed()
.compactMap({ try? $0.get() })
.first
// if we have no success cases, we will still have at least one response that we can
// rely on the 'get' method to throw the error for us, rather than unwrapping it ourselves
// if we have no success cases, we will still have at least
// one response that we can rely on the 'get' method to
// throw the error for us, rather than unwrapping it ourselves
else { return try results.first!.get() }

return latestSubscriptionCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ extension RedisConnectionPoolTests {
}
}

promises.forEach { $0.succeed(()) }
for promise in promises {
promise.succeed(())
}
_ = try EventLoopFuture<Void>
.whenAllSucceed(futures, on: pool.eventLoop)
.always { _ in
Expand Down

0 comments on commit e06f314

Please sign in to comment.