delayed_job_recurring 0.3.8 → 0.3.9

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
2
  SHA256:
3
- metadata.gz: 87b52e2ea46027c5744c95fa27a1638975c7c15d3b0a1b5c1a1cdc26de139f2b
4
- data.tar.gz: ef7cdcf38a80e0c6a696ef107af987baa7f4af7404a90dfce19b7c8b68704c83
3
+ metadata.gz: d2df13749a11ec5a5a5fef3f60eb7c7a1216e13a6b93a6e084392a30b0fabefd
4
+ data.tar.gz: 98bbe52c01ef1a79e4ce2c512a47d91e4a9380b8d119fc05605e13a27f805425
5
5
  SHA512:
6
- metadata.gz: 34922e47edf492128866c745520da14c23c8ac59e22bff14ccfdbb4d43376dac8406174fedca97e9006ee3a3f49d36ba1db5deb1e47d21286d37822dcdc57ebd
7
- data.tar.gz: '091153def899859de2afca9aa956a5678f94657ff85cfa917dff368abc71067c6857957de3382e66dd246b93efbb4456dfe53d15a498d6163b429262762d33a6'
6
+ metadata.gz: ec8ae92ce900948c73831b5b965e603032ee645e134b410af15f1e1b5392b5b3630252acac34ced89e3ff71d1334a37b7bd3fed212dabcc47d2ab37ee44d1294
7
+ data.tar.gz: bb8f9c77c3d0417b1e35861d7f81c8e8c82eb10963bdb32ffeef0b14f87cdfa2c8430259ddd8b7d494922434f6d38b1f8cb9f587f10373155218adec14cf36ae
data/README.md CHANGED
@@ -98,3 +98,7 @@ This allows you to schedule multiple jobs with same class if value of the unique
98
98
  ## Thanks!
99
99
 
100
100
  Many thanks to @ginjo and @kares for their work! This code was derived from https://gist.github.com/ginjo/3688965.
101
+
102
+ ## Contributing
103
+
104
+ [![Open Source Helpers](https://www.codetriage.com/amitree/delayed_job_recurring/badges/users.svg)](https://www.codetriage.com/amitree/delayed_job_recurring)
@@ -23,13 +23,17 @@ module Delayed
23
23
 
24
24
  # Schedule this "repeating" job
25
25
  def schedule! options = {}
26
- options = options.dup
26
+ options = options.dup.reverse_merge(@schedule_options || {})
27
+
28
+ if options[:new_instance] && !options.delete(:reentry)
29
+ return self.class.new.schedule! options.merge(reentry: true)
30
+ end
27
31
 
28
32
  if run_every = options.delete(:run_every)
29
33
  options[:run_interval] = serialize_duration(run_every)
30
34
  end
31
35
 
32
- @schedule_options = options.reverse_merge(@schedule_options || {}).reverse_merge(
36
+ @schedule_options = options.reverse_merge(
33
37
  run_at: self.class.run_at,
34
38
  timezone: self.class.timezone,
35
39
  run_interval: serialize_duration(self.class.run_every),
@@ -190,7 +194,7 @@ module Delayed
190
194
  def schedule!(options = {})
191
195
  return unless Delayed::Worker.delay_jobs
192
196
  unschedule(options)
193
- new.schedule!(options)
197
+ new.schedule!(options.merge(new_instance: true))
194
198
  end
195
199
 
196
200
  def scheduled?(options = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_recurring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Novak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -165,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.7.6
168
+ rubygems_version: 3.0.6
170
169
  signing_key:
171
170
  specification_version: 4
172
171
  summary: Recurring jobs for delayed_job