procrastinator 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -3
- data/.ruby-version +1 -1
- data/Gemfile +12 -0
- data/RELEASE_NOTES.md +14 -0
- data/lib/procrastinator/queue_worker.rb +12 -8
- data/lib/procrastinator/version.rb +1 -1
- data/procrastinator.gemspec +1 -11
- metadata +5 -131
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc44a4968d52be8482c61e47a86cd1773cd160e827f4ac8a6e4ac5fd3bbe6b8f
|
4
|
+
data.tar.gz: 8e3494bfa1a6494f16736c2937a20385cd8231b7615194c8f3b52dbf1d16a4e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0644921316f9db7ef0d1d3ee24fab20a5cf458077b16636e42d793387c9f9198e122ca959f113e777b82eb7d61983229f6a3afb09aab0931dce0fa507c6a13b
|
7
|
+
data.tar.gz: 4a2a86a807672c8b9335f1c835f90a80440045b787b75ff51d2e791e2f7075abb50be8e42362419742573ef1b160f262dae6eebb1d73b6377a635f5f805d85eb
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
inherit_from:
|
1
|
+
inherit_from: ~/.config/rubocop/config.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
4
|
Exclude:
|
5
5
|
- 'bin/*'
|
6
6
|
|
7
|
-
TargetRubyVersion: 2.
|
7
|
+
TargetRubyVersion: 2.7
|
8
8
|
|
9
9
|
Layout/LineLength:
|
10
10
|
Exclude:
|
@@ -23,4 +23,3 @@ Metrics/BlockLength:
|
|
23
23
|
Metrics/ModuleLength:
|
24
24
|
Exclude:
|
25
25
|
- 'spec/**/*.rb'
|
26
|
-
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.8
|
data/Gemfile
CHANGED
@@ -2,5 +2,17 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
|
+
group :development do
|
6
|
+
gem 'bundler', '~> 2.3'
|
7
|
+
gem 'fakefs', '~> 1.8'
|
8
|
+
gem 'rake', '~> 13.0'
|
9
|
+
gem 'rspec', '~> 3.9'
|
10
|
+
gem 'rubocop', '~> 1.12'
|
11
|
+
gem 'rubocop-performance', '~> 1.10'
|
12
|
+
gem 'simplecov', '~> 0.18.0'
|
13
|
+
gem 'timecop', '~> 0.9'
|
14
|
+
gem 'yard', '~> 0.9'
|
15
|
+
end
|
16
|
+
|
5
17
|
# Specify your gem's dependencies in procrastinator.gemspec
|
6
18
|
gemspec
|
data/RELEASE_NOTES.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
+
## 1.2.0 ( )
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
* none
|
8
|
+
|
9
|
+
### Minor Changes
|
10
|
+
|
11
|
+
* Updated minimum ruby to 2.7
|
12
|
+
|
13
|
+
### Bugfixes
|
14
|
+
|
15
|
+
* When logging is disabled, it points to `File::NULL` instead of a dead-end StringIO
|
16
|
+
|
3
17
|
## 1.1.0 (2022-10-16)
|
4
18
|
|
5
19
|
### Major Changes
|
@@ -13,6 +13,8 @@ module Procrastinator
|
|
13
13
|
# expected methods for all persistence strategies
|
14
14
|
PERSISTER_METHODS = [:read, :update, :delete].freeze
|
15
15
|
|
16
|
+
NULL_FILE = File.open(File::NULL, File::WRONLY)
|
17
|
+
|
16
18
|
def initialize(queue:, config:)
|
17
19
|
raise ArgumentError, ':queue cannot be nil' if queue.nil?
|
18
20
|
raise ArgumentError, ':config cannot be nil' if config.nil?
|
@@ -26,13 +28,13 @@ module Procrastinator
|
|
26
28
|
end
|
27
29
|
|
28
30
|
@scheduler = Scheduler.new(config)
|
29
|
-
@logger = Logger.new(
|
31
|
+
@logger = Logger.new(File::NULL)
|
30
32
|
end
|
31
33
|
|
32
34
|
# Works on jobs forever
|
33
35
|
def work!
|
34
36
|
@logger = open_log!("#{ name }-queue-worker", @config)
|
35
|
-
@logger.info
|
37
|
+
@logger.info "Started worker thread to consume queue: #{ name }"
|
36
38
|
|
37
39
|
loop do
|
38
40
|
sleep(@queue.update_period)
|
@@ -72,12 +74,14 @@ module Procrastinator
|
|
72
74
|
|
73
75
|
# Starts a log file and returns the created Logger
|
74
76
|
def open_log!(name, config)
|
75
|
-
|
76
|
-
|
77
|
-
log_path = config.log_dir / "#{ name }.log"
|
77
|
+
if config.log_level
|
78
|
+
log_path = config.log_dir / "#{ name }.log"
|
78
79
|
|
79
|
-
|
80
|
-
|
80
|
+
config.log_dir.mkpath
|
81
|
+
FileUtils.touch(log_path)
|
82
|
+
else
|
83
|
+
log_path = NULL_FILE
|
84
|
+
end
|
81
85
|
|
82
86
|
Logger.new(log_path.to_path,
|
83
87
|
config.log_shift_age, config.log_shift_size,
|
@@ -90,6 +94,6 @@ module Procrastinator
|
|
90
94
|
# Raised when a Task Storage strategy is missing a required part of the API.
|
91
95
|
#
|
92
96
|
# @see TaskStore
|
93
|
-
class MalformedTaskPersisterError <
|
97
|
+
class MalformedTaskPersisterError < RuntimeError
|
94
98
|
end
|
95
99
|
end
|
data/procrastinator.gemspec
CHANGED
@@ -23,15 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.required_ruby_version = '>= 2.
|
27
|
-
|
28
|
-
spec.add_development_dependency 'bundler', '~> 2.3'
|
29
|
-
spec.add_development_dependency 'fakefs', '~> 1.8'
|
30
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.9'
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 1.12'
|
33
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.10'
|
34
|
-
spec.add_development_dependency 'simplecov', '~> 0.18.0'
|
35
|
-
spec.add_development_dependency 'timecop', '~> 0.9'
|
36
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
26
|
+
spec.required_ruby_version = '>= 2.7'
|
37
27
|
end
|
metadata
CHANGED
@@ -1,141 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procrastinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.3'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.3'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: fakefs
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.8'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.8'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '13.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '13.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.9'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3.9'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.12'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1.12'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-performance
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.10'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.10'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: simplecov
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.18.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.18.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: timecop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.9'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.9'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: yard
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0.9'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0.9'
|
11
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
139
13
|
description: A flexible pure Ruby job queue. Tasks are reschedulable after failures.
|
140
14
|
email:
|
141
15
|
- robin@tenjin.ca
|
@@ -184,14 +58,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
58
|
requirements:
|
185
59
|
- - ">="
|
186
60
|
- !ruby/object:Gem::Version
|
187
|
-
version: '2.
|
61
|
+
version: '2.7'
|
188
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
63
|
requirements:
|
190
64
|
- - ">="
|
191
65
|
- !ruby/object:Gem::Version
|
192
66
|
version: '0'
|
193
67
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.4.10
|
195
69
|
signing_key:
|
196
70
|
specification_version: 4
|
197
71
|
summary: For apps to put off work until later
|