filesystem_queue 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/filesystem_queue/version.rb +1 -1
- data/lib/filesystem_queue.rb +10 -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: d990e413d523a1f7f803a4dd653c5ce8e6ddbba0de25d726607bc5184e725c3c
|
4
|
+
data.tar.gz: db3595416a552ad54297792d288cca66603ed71bd53d5629eddca72b383aae09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceba85b6215ccdd11186fe7f255cfff6eb3b4df90ba919c3b493af9c7f3a9b6a0f75239d4712ba70c558553756f13940bd2018071ddeb9d74bbbc860ed48cdec
|
7
|
+
data.tar.gz: e2571be6746a4b6fdd5063ae8ce796713db6d8bf446679cfd8a8f557fbb4c9fc0368af53a86f3a1d19a31c68c8f7a741f9c824d2720b83ad9d0b6245ac5d1382
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.0] - 2024-10-3
|
4
|
+
- Failed jobs have added metadata including `last_exception` and `retry_count`
|
5
|
+
|
3
6
|
## [0.3.0] - 2024-09-20
|
4
7
|
- Added `reenqueue_failed_jobs` method to move failed jobs back to the queue
|
5
8
|
- Added `reenqueue_completed_jobs` method to move completed jobs back to the queue
|
data/Gemfile.lock
CHANGED
data/lib/filesystem_queue.rb
CHANGED
@@ -44,7 +44,8 @@ module FilesystemQueue
|
|
44
44
|
move_job(job_file, @completed_dir)
|
45
45
|
end
|
46
46
|
|
47
|
-
def fail(job_file)
|
47
|
+
def fail(job_file, exception)
|
48
|
+
mark_failed_job(job_file, exception)
|
48
49
|
move_job(job_file, @failed_dir)
|
49
50
|
end
|
50
51
|
|
@@ -100,5 +101,13 @@ module FilesystemQueue
|
|
100
101
|
@index << new_job_file
|
101
102
|
end
|
102
103
|
end
|
104
|
+
|
105
|
+
# Adds metadata for the job for the retry count and the exception details
|
106
|
+
def mark_failed_job(job_file)
|
107
|
+
job_data = JSON.parse(File.read(job_file), symbolize_names: true)
|
108
|
+
job_data[:retry_count] = (job_data[:retry_count] || 0) + 1
|
109
|
+
job_data[:last_exception] = exception.message if exception
|
110
|
+
File.write(job_file, job_data.to_json)
|
111
|
+
end
|
103
112
|
end
|
104
113
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filesystem_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Westman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: FilesystemQueue is a Ruby gem that provides a persistent queue system
|
14
14
|
using the local filesystem.It allows you to enqueue and dequeue jobs, and keeps
|