services 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -6
- data/lib/services/logger/redis.rb +9 -5
- data/lib/services/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: ffdcdb285cbcbd081d2a061bab59150e91478fc0
|
4
|
+
data.tar.gz: b7ece5a7a3cf09b02d0020e0e188127c48e92415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299c7c815229e345be412a0f7ab4bca0d1da1848ac9e29935f0e74b378c9f7dea7e22efed1fe48856060815c68d9bfe0048279da27b313e711ef5dc65c24ef53
|
7
|
+
data.tar.gz: a5dd66ac67005ba9530e38a2e483bcde53583a044ffbff553dab3ad82123567408c3e281cef66d8c8055ec6638a4c8620b71c53136b91f743f8b3f6dca78d3df
|
data/README.md
CHANGED
@@ -10,7 +10,8 @@ module Services
|
|
10
10
|
Numeric
|
11
11
|
]
|
12
12
|
|
13
|
-
InvalidMetaError
|
13
|
+
InvalidMetaError = Class.new(StandardError)
|
14
|
+
EmptyResponseFromRedisMultiError = Class.new(StandardError)
|
14
15
|
|
15
16
|
def initialize(redis, key = 'logs')
|
16
17
|
@redis, @key = redis, key
|
@@ -38,10 +39,13 @@ module Services
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def clear
|
41
|
-
|
42
|
-
@redis.
|
43
|
-
|
44
|
-
|
42
|
+
response = 3.tries on: EmptyResponseFromRedisMultiError do
|
43
|
+
@redis.multi do
|
44
|
+
@redis.lrange @key, 0, -1
|
45
|
+
@redis.del @key
|
46
|
+
end or raise EmptyResponseFromRedisMultiError
|
47
|
+
end
|
48
|
+
response.first.map(&method(:log_entry_from_json))
|
45
49
|
end
|
46
50
|
|
47
51
|
private
|
data/lib/services/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Meurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|