scheduled_job 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: c9ef9b5bd8566235b6a1befa68badc08cf96670f
4
- data.tar.gz: 5f37b2668598ec438c4f34d6233696e7883dcb0f
3
+ metadata.gz: 712f66200583b9e067a22f431affda4671d851fe
4
+ data.tar.gz: e1cd08470ad32b62426ef84fbbe7beacff5d67e6
5
5
  SHA512:
6
- metadata.gz: 7f13ba7f35eadc34d793c0282ccc437b71dc20e1e6ff97461cd58acaaea857a49725170ad350db36b812da4ce9f5128bc5ebf3f5ecefcb5f5afa3eb019f2b682
7
- data.tar.gz: dd3475e7da5a8db5f796f8d1d21d5ccfb4bf55ec33723260dede2bec9b4316943cbb6919796d0c6dff648cc6c6f5421c35676a4b8b2b19c16b2a9fc9f266baea
6
+ metadata.gz: 2fde7757c4786f6e662025793b4c8898b6d8662ae34ebb93dd309fdac1c19443bb7a0d240938406e1656db9ec7a2420f0ddf601569f29fc1327b0a77cdf00cae
7
+ data.tar.gz: d3ee92b75600556d67947287ae7c6885276675d5a8a3dbb708cf407b50a7afb19965e8bcf346ea5dc67fa65bc0ded48626052a2634ca88bca896eb7953899f32
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- - 2.1.1
4
+ - 2.2.2
data/CHANGELOG.md CHANGED
@@ -25,3 +25,6 @@ Adds a config to allow the scheduling for more than one instance of the same job
25
25
 
26
26
  # 0.1.1
27
27
  Allows jobs in config to be strings, symbols, or classes. If a string or symbol is provided, it will be resolved to a constant before scheduling the job.
28
+
29
+ # 0.1.2
30
+ Falls back to the Delayed Job default queue name if none is provided. Ensures that the run at is set using UTC timezone. Updates specs to run on the latest ruby version on CI.
@@ -1,3 +1,3 @@
1
1
  module ScheduledJob
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/scheduled_job.rb CHANGED
@@ -68,7 +68,7 @@ module ScheduledJob
68
68
 
69
69
  def failure(job)
70
70
  ScheduledJob.logger.error("DelayedJob failed: processing job in queue #{self.class.queue_name} failed")
71
- job.update_attributes!(:failed_at => Time.now)
71
+ job.update_attributes!(:failed_at => Time.now.utc)
72
72
  self.class.schedule_job
73
73
  end
74
74
 
@@ -91,10 +91,6 @@ module ScheduledJob
91
91
  end
92
92
  end
93
93
 
94
- def queue_name
95
- "Default"
96
- end
97
-
98
94
  def random_minutes(base, random_delta)
99
95
  random_delta *= -1 if random_delta < 0
100
96
  (base + Random.new.rand((-1 * random_delta)..random_delta)).minutes
@@ -119,5 +115,9 @@ module ScheduledJob
119
115
  def run_duration_threshold
120
116
  self.const_defined?(:RUN_DURATION_THRESHOLD) ? self::RUN_DURATION_THRESHOLD : nil
121
117
  end
118
+
119
+ def queue_name
120
+ Delayed::Worker.default_queue_name
121
+ end
122
122
  end
123
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scheduled_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CallumD
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-04-17 00:00:00.000000000 Z
14
+ date: 2015-06-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: delayed_job