Skip to content

Commit

Permalink
Update Redis in CI, lower #no of connections
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Aug 8, 2024
1 parent a2a09ff commit 1f19b64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

services:
redis:
image: redis:6
image: redis:7
ports:
- 6379:6379

Expand Down
7 changes: 5 additions & 2 deletions httprateredis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func TestRedisCounter(t *testing.T) {
limitCounter, err := httprateredis.NewRedisLimitCounter(&httprateredis.Config{
Host: "localhost",
Port: 6379,
MaxIdle: 100,
MaxActive: 200,
MaxIdle: 0,
MaxActive: 2,
DBIndex: 0,
ClientName: "httprateredis_test",
PrefixKey: fmt.Sprintf("httprate:test:%v", rand.Int31n(100000)), // Unique Redis key for each test
Expand Down Expand Up @@ -162,7 +162,10 @@ func BenchmarkLocalCounter(b *testing.B) {
DBIndex: 0,
ClientName: "httprateredis_test",
PrefixKey: fmt.Sprintf("httprate:test:%v", rand.Int31n(100000)), // Unique key for each test
MaxActive: 1,
MaxIdle: 0,
FallbackDisabled: true,
FallbackTimeout: 5 * time.Second,
})
if err != nil {
b.Fatalf("redis not available: %v", err)
Expand Down

0 comments on commit 1f19b64

Please sign in to comment.