nexaas-async-collector 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d6262f078636b043ae567b9f2e0e9318b86b80c
|
4
|
+
data.tar.gz: 85abf3a76680a3194b366fc6de0459cd86d65142
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4579d88011523cb251fa330a11cd07db1d357430148daed76cd61c49b3c9d2131844e463191cf28e6c044974d74b1e6dcdc255e6804f61dca6e17bfc04106efb
|
7
|
+
data.tar.gz: 907207719835d0f6589ecdbafbe248d98e24e9f03b1c6dc6629c885cd3a0b6db32a30d0ebb4432e6ce1c0b52f864b37f3a678a09d8e6a5d9d5fbb88c7c245af3
|
@@ -3,26 +3,24 @@ module Nexaas
|
|
3
3
|
module Collector
|
4
4
|
class InMemoryStorage
|
5
5
|
|
6
|
-
attr_reader :connection, :namespace
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@connection ||= Redis.new(url: redis_url)
|
10
|
-
@namespace ||= Redis::Namespace.new(redis_namespace, redis: connection) if redis_namespace
|
11
|
-
end
|
12
|
-
|
13
6
|
def get(key)
|
14
|
-
|
7
|
+
Sidekiq.redis_pool.with do |connection|
|
8
|
+
connection.get(namespaced_key(key))
|
9
|
+
end
|
15
10
|
end
|
16
11
|
|
17
12
|
def set(key, value, expiration=nil)
|
18
|
-
|
19
|
-
|
13
|
+
Sidekiq.redis_pool.with do |connection|
|
14
|
+
key = namespaced_key(key)
|
15
|
+
connection.set(key, value)
|
16
|
+
connection.expire(key, expiration) if expiration
|
17
|
+
end
|
20
18
|
end
|
21
19
|
|
22
20
|
private
|
23
21
|
|
24
|
-
def
|
25
|
-
|
22
|
+
def namespaced_key(key)
|
23
|
+
"#{redis_namespace}:#{key}"
|
26
24
|
end
|
27
25
|
|
28
26
|
def redis_url
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexaas-async-collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Hertz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4.2'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: redis-namespace
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.5.2
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.5.2
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|