mini_scheduler 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 +5 -5
- data/lib/generators/mini_scheduler/install/install_generator.rb +1 -0
- data/lib/generators/mini_scheduler/install/templates/mini_scheduler_initializer.rb +7 -0
- data/lib/mini_scheduler.rb +5 -0
- data/lib/mini_scheduler/version.rb +1 -1
- data/lib/mini_scheduler/web.rb +4 -0
- data/mini_scheduler.gemspec +2 -7
- metadata +9 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5c82db0632cc943974c151691df062c1d9cf174f
|
4
|
+
data.tar.gz: 8d0f504ebda4035f57302ceff4dfdbe2a52c6c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e90d2538ae7d3ccd4c85cd31125fa9d2b3d9e5e1fbd63726f66c13ae2094c5b9b352b61a13f8ce1f1ecb2ecdcd6c4b84c2a1726ec3561e868e5a50ae070b4f40
|
7
|
+
data.tar.gz: 230dc118e9bc88e9c7f9f81a63157b4767c621d45f3524e14e9f334a55176c9aa234bf24c514e5b37b23a056e9e5e945c670ebad16bbeeb713276b5bf89ac359
|
@@ -18,6 +18,13 @@ MiniScheduler.configure do |config|
|
|
18
18
|
# config.job_ran do |stats|
|
19
19
|
# ...
|
20
20
|
# end
|
21
|
+
|
22
|
+
# Add code that runs before processing requests to the
|
23
|
+
# scheduler pages of the Sidekiq web UI.
|
24
|
+
|
25
|
+
# config.before_sidekiq_web_request do
|
26
|
+
# ...
|
27
|
+
# end
|
21
28
|
end
|
22
29
|
|
23
30
|
if Sidekiq.server? && defined?(Rails)
|
data/lib/mini_scheduler.rb
CHANGED
@@ -42,6 +42,11 @@ module MiniScheduler
|
|
42
42
|
@job_ran
|
43
43
|
end
|
44
44
|
|
45
|
+
def self.before_sidekiq_web_request(&blk)
|
46
|
+
@before_sidekiq_web_request = blk if blk
|
47
|
+
@before_sidekiq_web_request
|
48
|
+
end
|
49
|
+
|
45
50
|
def self.start
|
46
51
|
manager = Manager.new
|
47
52
|
Manager.discover_schedules.each do |schedule|
|
data/lib/mini_scheduler/web.rb
CHANGED
@@ -22,6 +22,7 @@ module MiniScheduler
|
|
22
22
|
end
|
23
23
|
|
24
24
|
app.get "/scheduler" do
|
25
|
+
MiniScheduler.before_sidekiq_web_request&.call
|
25
26
|
@schedules = Manager.discover_schedules.sort do |a, b|
|
26
27
|
a_next = a.schedule_info.next_run
|
27
28
|
b_next = b.schedule_info.next_run
|
@@ -37,6 +38,7 @@ module MiniScheduler
|
|
37
38
|
end
|
38
39
|
|
39
40
|
app.get "/scheduler/history" do
|
41
|
+
MiniScheduler.before_sidekiq_web_request&.call
|
40
42
|
@scheduler_stats = Stat.order('started_at desc').limit(200)
|
41
43
|
erb File.read(File.join(VIEWS, 'history.erb')), locals: { view_path: VIEWS }
|
42
44
|
end
|
@@ -44,6 +46,8 @@ module MiniScheduler
|
|
44
46
|
app.post "/scheduler/:name/trigger" do
|
45
47
|
halt 404 unless (name = params[:name])
|
46
48
|
|
49
|
+
MiniScheduler.before_sidekiq_web_request&.call
|
50
|
+
|
47
51
|
klass = name.constantize
|
48
52
|
info = klass.schedule_info
|
49
53
|
info.next_run = Time.now.to_i
|
data/mini_scheduler.gemspec
CHANGED
@@ -22,13 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
end
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "
|
27
|
-
spec.add_development_dependency "minitest", "~> 5.0"
|
28
|
-
spec.add_development_dependency "pg", "~> 1.0.0"
|
29
|
-
spec.add_development_dependency "guard", "~> 2.14"
|
30
|
-
spec.add_development_dependency "guard-minitest", "~> 2.4"
|
31
|
-
spec.add_development_dependency "activesupport", "~> 5.2"
|
25
|
+
spec.add_development_dependency "pg", ">= 1.0"
|
26
|
+
spec.add_development_dependency "activesupport", ">= 5.2"
|
32
27
|
spec.add_development_dependency "rspec"
|
33
28
|
spec.add_development_dependency "mocha"
|
34
29
|
spec.add_development_dependency "mock_redis"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_scheduler
|
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
|
- Sam Saffron
|
@@ -9,104 +9,34 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-07-
|
12
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.16'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.16'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: rake
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '10.0'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '10.0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: minitest
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '5.0'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '5.0'
|
56
14
|
- !ruby/object:Gem::Dependency
|
57
15
|
name: pg
|
58
16
|
requirement: !ruby/object:Gem::Requirement
|
59
17
|
requirements:
|
60
|
-
- - "
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 1.0.0
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 1.0.0
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: guard
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '2.14'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '2.14'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: guard-minitest
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
18
|
+
- - ">="
|
89
19
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
20
|
+
version: '1.0'
|
91
21
|
type: :development
|
92
22
|
prerelease: false
|
93
23
|
version_requirements: !ruby/object:Gem::Requirement
|
94
24
|
requirements:
|
95
|
-
- - "
|
25
|
+
- - ">="
|
96
26
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
27
|
+
version: '1.0'
|
98
28
|
- !ruby/object:Gem::Dependency
|
99
29
|
name: activesupport
|
100
30
|
requirement: !ruby/object:Gem::Requirement
|
101
31
|
requirements:
|
102
|
-
- - "
|
32
|
+
- - ">="
|
103
33
|
- !ruby/object:Gem::Version
|
104
34
|
version: '5.2'
|
105
35
|
type: :development
|
106
36
|
prerelease: false
|
107
37
|
version_requirements: !ruby/object:Gem::Requirement
|
108
38
|
requirements:
|
109
|
-
- - "
|
39
|
+
- - ">="
|
110
40
|
- !ruby/object:Gem::Version
|
111
41
|
version: '5.2'
|
112
42
|
- !ruby/object:Gem::Dependency
|
@@ -212,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
142
|
version: '0'
|
213
143
|
requirements: []
|
214
144
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.6.14
|
216
146
|
signing_key:
|
217
147
|
specification_version: 4
|
218
148
|
summary: Adds recurring jobs for Sidekiq
|