simple_scheduler 1.1.0 → 1.1.1
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 +5 -5
- data/lib/simple_scheduler/scheduler_job.rb +2 -1
- data/lib/simple_scheduler/task.rb +4 -4
- data/lib/simple_scheduler/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f142ecc49b508ef2a79c390117fb6afb09834ac478ee7cd59fad7f48cf4bdd90
|
4
|
+
data.tar.gz: be59002f28130c9841b4f96c3fa5c79654e035b4e3ee29b7da7d208836b6d86f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eca24d40adfc372df948beacf0d390116fd8961b1e5d9dae36415da4f7035574b9e61b847cf2c890f43dfe6ef2c8fd55171a81daf7b08aa9fb5fa972fa73116
|
7
|
+
data.tar.gz: 26d1cc5f13e130ad71871ccc470adbeb6a8abd7c12379cf3a5b9cf1175eaeaa52e998eab1a9384808d6693732f61c34f262b9963d148a4846f68889efd40655b
|
@@ -29,7 +29,8 @@ module SimpleScheduler
|
|
29
29
|
def queue_future_jobs
|
30
30
|
tasks.each do |task|
|
31
31
|
# Schedule the new run times using the future job wrapper.
|
32
|
-
task.future_run_times
|
32
|
+
new_run_times = task.future_run_times - task.existing_run_times
|
33
|
+
new_run_times.each do |time|
|
33
34
|
SimpleScheduler::FutureJob.set(queue: @queue_name, wait_until: time)
|
34
35
|
.perform_later(task.params, time.to_i)
|
35
36
|
end
|
@@ -65,17 +65,17 @@ module SimpleScheduler
|
|
65
65
|
# @return [Array<Time>]
|
66
66
|
# rubocop:disable Metrics/AbcSize
|
67
67
|
def future_run_times
|
68
|
-
|
68
|
+
future_run_times = existing_run_times.dup
|
69
|
+
last_run_time = future_run_times.last || at - frequency
|
69
70
|
last_run_time = last_run_time.in_time_zone(time_zone)
|
70
|
-
future_run_times = []
|
71
71
|
|
72
72
|
# Ensure there are at least two future jobs scheduled and that the queue ahead time is filled
|
73
|
-
while
|
73
|
+
while future_run_times.length < 2 || minutes_queued_ahead(last_run_time) < queue_ahead
|
74
74
|
last_run_time = frequency.from_now(last_run_time)
|
75
75
|
# The hour may not match because of a shift caused by DST in previous run times,
|
76
76
|
# so we need to ensure that the hour matches the specified hour if given.
|
77
77
|
last_run_time = last_run_time.change(hour: at.hour, min: at.min) if at.hour?
|
78
|
-
future_run_times << last_run_time
|
78
|
+
future_run_times << last_run_time
|
79
79
|
end
|
80
80
|
|
81
81
|
future_run_times
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pattison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -162,8 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
|
166
|
-
rubygems_version: 2.5.2.3
|
165
|
+
rubygems_version: 3.0.3
|
167
166
|
signing_key:
|
168
167
|
specification_version: 4
|
169
168
|
summary: An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific
|