belated 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -2
- data/lib/belated/version.rb +1 -1
- data/lib/belated.rb +5 -0
- 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: e9ffd4fd7fb145286210861d0b2977e20ec4ed28cf776d753b887c6b8cfe384d
|
4
|
+
data.tar.gz: e9b006476fa67f3acdcae7a8dfff4da8275f7af4e4ecbada93b462f803fab4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1dd51345d62775d2920abf015e804c8cb85c01155e9df75d59e2282d13c892270e0346b661c7896c226862f808d584157c898aa2e6b6a7247f877447842307b
|
7
|
+
data.tar.gz: 57a1cd7805029a009d2d0b7495eba264325813868c0c3a30984fc6a3b4bb8fcdd400257f1d31ce8277d17848f36c61e19d223e15f429161dcd5d190258809151
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.8.1] - 2021-09-09
|
4
|
+
- Now you can delete jobs from the future jobs queue. This is useful if you want to delete a job that is scheduled for a future date.
|
5
|
+
|
3
6
|
## [0.8] - 2021-09-08
|
4
7
|
- Using PStore for future jobs backup and job history. Job history is rotated daily, future jobs cannot at the moment.
|
5
8
|
- PStore has ultrasafe mode, should test whether that makes things very slow. If not, might be worth using it for the peace of mind. Or at least have it as an option.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -74,8 +74,17 @@ client.perform_belated(DumDum.new, at: Time.now + 5 * 60)
|
|
74
74
|
client.perform_belated(DumDum.new, max_retries: 3) # default 5
|
75
75
|
```
|
76
76
|
|
77
|
-
|
78
|
-
|
77
|
+
You can also fetch jobs from the future jobs queue:
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
job = client.perform_belated(proc { 0 / 0 }, at: Time.now + 5 * 60)
|
81
|
+
Belated.find job.id # Find the job if it's in the future queue
|
82
|
+
# Oh no, that job looks a bit weird!
|
83
|
+
# Let's delete it:
|
84
|
+
Belated.delete job.id
|
85
|
+
```
|
86
|
+
|
87
|
+
Belated runs on localhost, port 8788 by default, but the port is configurable, see below.
|
79
88
|
|
80
89
|
## Rails
|
81
90
|
|
data/lib/belated/version.rb
CHANGED
data/lib/belated.rb
CHANGED
@@ -145,6 +145,11 @@ class Belated
|
|
145
145
|
@@queue.future_jobs.find { |job| job.id == job_id }
|
146
146
|
end
|
147
147
|
|
148
|
+
def delete(job_id)
|
149
|
+
job = find(job_id)
|
150
|
+
@@queue.future_jobs.delete(job)
|
151
|
+
end
|
152
|
+
|
148
153
|
def kill_and_clear_queue!
|
149
154
|
@worker_list&.each do |worker|
|
150
155
|
Thread.kill(worker)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: belated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sampo Kuokkanen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: drb
|