Skip to content

Commit 8c0c9f9

Browse files
committed
Memoize Experiment#start_time over the period of this instance
1 parent e8df7bf commit 8c0c9f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/split/experiment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def start
175175
end
176176

177177
def start_time
178-
Split.cache(:experiment_start_times, @name) do
178+
@start_time ||= Split.cache(:experiment_start_times, @name) do
179179
t = redis.hget(:experiment_start_times, @name)
180180
if t
181181
# Check if stored time is an integer

0 commit comments

Comments
 (0)