progressrus 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/progressrus/store/redis.rb +8 -2
- data/lib/progressrus/version.rb +1 -1
- data/lib/progressrus.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: 7a78b4e02d15a9e3314128bf5e8a3d5a4e8cc3e1
|
4
|
+
data.tar.gz: dcb6e66cdf32a3ffb40aedafcc8057f8be22b276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b175333d4fef5fc9265a93974b644c86dc8e4072ff13d9cee3c312ce4fe0364b32c51352cac46fdcd8a11a172bdbbb14747757a7f813390af1cb9f5fcf325829
|
7
|
+
data.tar.gz: d550e3cfa6e85d0bec160e1c8c04fa5fc6c9c539659cc693368f630e569c097da2541eb7ade713c6fa1faeb3ded495b3ce0d7e569371c8f5684458337e3698db
|
@@ -13,9 +13,15 @@ class Progressrus
|
|
13
13
|
@prefix = prefix
|
14
14
|
end
|
15
15
|
|
16
|
-
def persist(progress, now: Time.now, force: false)
|
16
|
+
def persist(progress, now: Time.now, force: false, expires_at: nil)
|
17
17
|
if outdated?(progress) || force
|
18
|
-
|
18
|
+
key_for_scope = key(progress.scope)
|
19
|
+
|
20
|
+
redis.pipelined do
|
21
|
+
redis.hset(key_for_scope, progress.id, progress.to_serializeable.to_json)
|
22
|
+
redis.expireat(key_for_scope, expires_at) if expires_at
|
23
|
+
end
|
24
|
+
|
19
25
|
@persisted_ats[progress.scope][progress.id] = now
|
20
26
|
end
|
21
27
|
rescue *BACKEND_EXCEPTIONS => e
|
data/lib/progressrus/version.rb
CHANGED
data/lib/progressrus.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: progressrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Eskildsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|