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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 8f80dba7428c2a8aa9ab7993aaedc20623997a4710fe13856826361b23d3b2b7
4
- data.tar.gz: 42eeeafbf3c3764883560f4fc38cfdf59cf9ea7eea30b95111582ff81b98a452
2
+ SHA1:
3
+ metadata.gz: 5c82db0632cc943974c151691df062c1d9cf174f
4
+ data.tar.gz: 8d0f504ebda4035f57302ceff4dfdbe2a52c6c83
5
5
  SHA512:
6
- metadata.gz: 195412471e37e96582ef2ee9b2ee0d7107f5d2113c918aacd4cf85fb9135d751ae189f8a32beca9bd9719cf0acb54c47a008527585eb48265be239cca54e4bb1
7
- data.tar.gz: b5ee5701360abf05b16179200dcc56bcbc0bc9203edf2a8cd2038f527dd8dab0513f0563f381ebfbb601d550a0c365ab22ed8f8879434d98caaabf5f6cb1e6fa
6
+ metadata.gz: e90d2538ae7d3ccd4c85cd31125fa9d2b3d9e5e1fbd63726f66c13ae2094c5b9b352b61a13f8ce1f1ecb2ecdcd6c4b84c2a1726ec3561e868e5a50ae070b4f40
7
+ data.tar.gz: 230dc118e9bc88e9c7f9f81a63157b4767c621d45f3524e14e9f334a55176c9aa234bf24c514e5b37b23a056e9e5e945c670ebad16bbeeb713276b5bf89ac359
@@ -1,5 +1,6 @@
1
1
  require 'rails/generators'
2
2
  require 'rails/generators/migration'
3
+ require 'active_record'
3
4
 
4
5
  module MiniScheduler
5
6
  module Generators
@@ -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)
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module MiniScheduler
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -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
@@ -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 "bundler", "~> 1.16"
26
- spec.add_development_dependency "rake", "~> 10.0"
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.0
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-11 00:00:00.000000000 Z
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: '2.4'
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: '2.4'
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.7.7
145
+ rubygems_version: 2.6.14
216
146
  signing_key:
217
147
  specification_version: 4
218
148
  summary: Adds recurring jobs for Sidekiq