Skip to content

Commit 3c7a46e

Browse files
committed
Break out of the loop when the key is found
The purpose of the loop is to loop through the flag keys and evaluate the one where `flag["key"] == key`. Once that key is found, there's no need to continue the loop.
1 parent f8bf011 commit 3c7a46e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

posthog/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ def get_feature_flag(
701701
except Exception as e:
702702
self.log.exception(f"[FEATURE FLAGS] Error while computing variant locally: {e}")
703703
continue
704+
break
704705

705706
flag_was_locally_evaluated = response is not None
706707
if not flag_was_locally_evaluated and not only_evaluate_locally:

0 commit comments

Comments
 (0)