verdict 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/verdict/experiment.rb +4 -0
- data/lib/verdict/storage/legacy_redis_storage.rb +6 -1
- data/lib/verdict/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e529fa9948f7f7176df69a622210e40594d3c91
|
4
|
+
data.tar.gz: e576284cd0a3eed14ebb597acf31bbf87b86a681
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8347a5f689329717098cb9d9d42c3c78731a55863e5f1fe8c6debf6db3f8155ffd65fb22b4d7af50d05a05e1980af41d42e5a72bef81ce84cd43371b045bf0e9
|
7
|
+
data.tar.gz: 3a27b4ff3dd5db6705be1f715cfd1e8860a5df9c1b54344f5e3693ea6bf426d8c40f6b3d2a1e6f2007f0a7c94057325fb18c2dabe9e1ed5f1dc287e5c1db7a8e
|
data/.travis.yml
CHANGED
data/lib/verdict/experiment.rb
CHANGED
@@ -76,6 +76,8 @@ class Verdict::Experiment
|
|
76
76
|
|
77
77
|
def started_at
|
78
78
|
@started_at ||= @storage.retrieve_start_timestamp(self)
|
79
|
+
rescue Verdict::StorageError => e
|
80
|
+
nil
|
79
81
|
end
|
80
82
|
|
81
83
|
def started?
|
@@ -264,5 +266,7 @@ class Verdict::Experiment
|
|
264
266
|
|
265
267
|
def ensure_experiment_has_started
|
266
268
|
@started_at ||= @storage.retrieve_start_timestamp(self) || set_start_timestamp
|
269
|
+
rescue Verdict::StorageError
|
270
|
+
@started_at ||= Time.now.utc
|
267
271
|
end
|
268
272
|
end
|
@@ -30,19 +30,24 @@ module Verdict
|
|
30
30
|
|
31
31
|
def remove_assignment(experiment, subject_identifier)
|
32
32
|
redis.hdel(generate_experiment_key(experiment), subject_identifier)
|
33
|
+
rescue ::Redis::BaseError => e
|
34
|
+
raise Verdict::StorageError, "Redis error: #{e.message}"
|
33
35
|
end
|
34
36
|
|
35
37
|
def retrieve_start_timestamp(experiment)
|
36
38
|
if started_at = redis.get(generate_experiment_start_timestamp_key(experiment))
|
37
39
|
DateTime.parse(started_at).to_time
|
38
40
|
end
|
41
|
+
rescue ::Redis::BaseError => e
|
42
|
+
raise Verdict::StorageError, "Redis error: #{e.message}"
|
39
43
|
end
|
40
44
|
|
41
45
|
def store_start_timestamp(experiment, timestamp)
|
42
46
|
redis.setnx(generate_experiment_start_timestamp_key(experiment), timestamp.to_s)
|
47
|
+
rescue ::Redis::BaseError => e
|
48
|
+
raise Verdict::StorageError, "Redis error: #{e.message}"
|
43
49
|
end
|
44
50
|
|
45
|
-
|
46
51
|
private
|
47
52
|
|
48
53
|
def generate_experiment_key(experiment)
|
data/lib/verdict/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: verdict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|