Skip to content

Commit

Permalink
chore: allows resolving a single toggle to do that instead of iterati…
Browse files Browse the repository at this point in the history
…ng the whole hashmap (#215)
  • Loading branch information
sighphyre authored Jun 23, 2023
1 parent e6b53a0 commit 0920dad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tracing = {version = "0.1.37", features = ["log"]}
tracing-subscriber = {version = "0.3.17", features = ["json", "env-filter"]}
ulid = "1.0.0"
unleash-types = { version = "0.10.1", features = ["openapi", "hashes"]}
unleash-yggdrasil = { version = "0.5.7" }
unleash-yggdrasil = { version = "0.5.8" }
utoipa = {version = "3", features = ["actix_extras", "chrono"]}
utoipa-swagger-ui = {version = "3", features = ["actix-web"]}
[dev-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions server/src/frontend_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ pub fn evaluate_feature(
.clone();
engine_cache
.get(&cache_key(&validated_token))
.and_then(|engine| engine.resolve_all(&context_with_ip))
.and_then(|toggles| toggles.get(&feature_name).cloned())
.and_then(|engine| engine.resolve(&feature_name, &context_with_ip))
.and_then(|resolved_toggle| {
if validated_token.projects.contains(&"*".into())
|| validated_token.projects.contains(&resolved_toggle.project)
Expand Down

0 comments on commit 0920dad

Please sign in to comment.