Skip to content

Commit

Permalink
feat: update IsProFeatureEnabled for external.platform features
Browse files Browse the repository at this point in the history
  • Loading branch information
lizardruss committed Jun 25, 2024
1 parent 78c8a9e commit 567f460
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ func (c *Config) IsProFeatureEnabled() bool {
return true
}

if len(c.External["platform"]) > 0 {
return true
}

return false
}

Expand Down
13 changes: 13 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,19 @@ func TestConfig_IsProFeatureEnabled(t *testing.T) {
},
expected: true,
},
{
name: "External Platform configuration used",
config: &Config{
External: map[string]ExternalConfig{
"platform": map[string]interface{}{
"autoSleep": map[string]interface{}{
"afterInactivity": 300,
},
},
},
},
expected: true,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 567f460

Please sign in to comment.