From 08c511b8a821aa6a442eb5a00dad30058f36f2a3 Mon Sep 17 00:00:00 2001 From: Matt Hammerly Date: Thu, 19 Sep 2024 12:14:34 -0700 Subject: [PATCH] create Feature db record in constructor, not just in check_value() --- shared/rollouts/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/rollouts/__init__.py b/shared/rollouts/__init__.py index b3cd6dc3f..f556c9d84 100644 --- a/shared/rollouts/__init__.py +++ b/shared/rollouts/__init__.py @@ -112,6 +112,10 @@ def __init__( self.feature_flag = feature_flag self.ff_variants = ff_variants + # Force the feature to be created in the database when it is initialized + # and not just when `check_value()` is called. + self._fetch_and_set_from_db() + # See if this environment has disabled feature flagging entirely. # These environments will always get default values. self.env_disable = os.getenv("CODECOV__FEATURE__DISABLE") is not None