Skip to content

Commit 792d8c4

Browse files
committed
Silence errors about feature flags not existing
This fixes an issue where we get an error message about a feature flag not existing when we try and create the feature flag in the factory. It appears as though this is a bug or regression in Flipper itself, but for now there is a workaround we can use to at least silence the error: flippercloud/flipper#990
1 parent 3e1bceb commit 792d8c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/lib/feature_flag_factory.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ def self.call
77
File.read(Rails.root.join("config/feature_flags.yml"))
88
).keys
99

10-
names.each { Flipper.add(it) unless Flipper.exist?(it) }
10+
Flipper::Adapters::Strict.with_sync_mode do
11+
names.each { Flipper.add(it) unless Flipper.exist?(it) }
12+
end
1113

1214
Flipper.features.each do |feature|
1315
feature.remove unless feature.name.to_s.in?(names)

0 commit comments

Comments
 (0)