Skip to content

Commit b1714e5

Browse files
MarkRoddyandrew
authored andcommitted
Convience function around enumerating a user's current active experiments which also honors the 'db_failover' option. (#1) (#487)
1 parent ae6f639 commit b1714e5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/split/helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ def ab_record_extra_info(metric_descriptor, key, value = 1)
9696
Split.configuration.db_failover_on_db_error.call(e)
9797
end
9898

99+
def ab_active_experiments()
100+
ab_user.active_experiments
101+
rescue => e
102+
raise unless Split.configuration.db_failover
103+
Split.configuration.db_failover_on_db_error.call(e)
104+
end
105+
106+
99107
def override_present?(experiment_name)
100108
override_alternative(experiment_name)
101109
end

0 commit comments

Comments
 (0)