esse-redis_storage 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/lib/esse/redis_storage/config.rb +1 -1
- data/lib/esse/redis_storage/queue.rb +4 -2
- data/lib/esse/redis_storage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbe607977885ccd2e85b297251b0b2412ecb0cd36658a812db840d575dfb3207
|
4
|
+
data.tar.gz: f02f2eb3d65897a7630b128ecd5150a3c4d9c247617158a85445aa44a0ee6b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b26d864ec031ae339b177df8e3f2bf0e6ad3b7c9c08a6dc46b6ba085fbdd9f9e618d5351910a621d64ce6d9151a79b04a316c7958570ff447992aeb3fc61a397
|
7
|
+
data.tar.gz: 13404ce338c0603630713cf7f4429557a0580de4640509852924b6cb6a6291403247ad622c8c07e8e4cab28ffc19d53baadb1ae770dd86d79db98a2883caa82c
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 0.1.2 - 2024-08-08
|
8
|
+
* Add `redis_queue_ttl` configuration option to the `Esse::Config` class.
|
9
|
+
|
10
|
+
## 0.1.1 - 2024-08-06
|
11
|
+
* Add TTL to the enqueued items in the queue.
|
12
|
+
* Included current time in the rand batch id to be more human readable.
|
13
|
+
|
14
|
+
## 0.1.0 - 2024-07-31
|
15
|
+
* Adjusting queue to allow to enqueue complex objects like Ruby hash and also preserve the primitive type.
|
16
|
+
|
7
17
|
## 0.0.2 - 2024-07-18
|
8
18
|
* The `Esse::RedisStorage::Queue.for` method now support both `repo:` and `attribute_name:` options.
|
9
19
|
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,7 @@ module Esse
|
|
13
13
|
attr_reader :name
|
14
14
|
|
15
15
|
def self.batch_id
|
16
|
-
SecureRandom.
|
16
|
+
String.new(Time.now.strftime("%Y%m%d%H%M%S%L-")) << SecureRandom.hex(4)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.for(repo:, attribute_name: nil)
|
@@ -28,13 +28,15 @@ module Esse
|
|
28
28
|
# Enqueue a batch of ids to process
|
29
29
|
# @param id [String] The batch id
|
30
30
|
# @param values [Array<String>] The values of the batch
|
31
|
-
def enqueue(id: nil, values: [])
|
31
|
+
def enqueue(id: nil, values: [], ttl: nil)
|
32
32
|
return if values.nil? || values.empty?
|
33
33
|
|
34
|
+
ttl ||= Esse.config.redis_queue_ttl
|
34
35
|
values = ::Esse::ArrayUtils.wrap(values)
|
35
36
|
batch_id = id || self.class.batch_id
|
36
37
|
with do |conn|
|
37
38
|
conn.hset(name, batch_id, ::MultiJson.dump(values))
|
39
|
+
conn.expire(name, ttl) if ttl
|
38
40
|
end
|
39
41
|
batch_id
|
40
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esse-redis_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos G. Zimmermann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: esse
|