Skip to content

Commit

Permalink
redis config: allow setting timeout to 0 (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething authored Feb 2, 2024
1 parent 454dbdc commit c803ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion digitalocean/database/resource_database_redis_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func updateRedisConfig(ctx context.Context, d *schema.ResourceData, client *godo
opts.RedisSSL = godo.PtrTo(v.(bool))
}

if v, ok := d.GetOk("timeout"); ok {
if v, ok := d.GetOkExists("timeout"); ok {
opts.RedisTimeout = godo.PtrTo(v.(int))
}

Expand Down
4 changes: 2 additions & 2 deletions digitalocean/database/resource_database_redis_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func TestAccDigitalOceanDatabaseRedisConfig_Basic(t *testing.T) {
),
},
{
Config: fmt.Sprintf(testAccCheckDigitalOceanDatabaseRedisConfigConfigBasic, dbConfig, "allkeys-lru", 600, "KEA"),
Config: fmt.Sprintf(testAccCheckDigitalOceanDatabaseRedisConfigConfigBasic, dbConfig, "allkeys-lru", 0, "KEA"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(
"digitalocean_database_redis_config.foobar", "maxmemory_policy", "allkeys-lru"),
resource.TestCheckResourceAttr(
"digitalocean_database_redis_config.foobar", "timeout", "600"),
"digitalocean_database_redis_config.foobar", "timeout", "0"),
resource.TestCheckResourceAttr(
"digitalocean_database_redis_config.foobar", "notify_keyspace_events", "KEA"),
resource.TestCheckResourceAttr(
Expand Down

0 comments on commit c803ea5

Please sign in to comment.