sidekiq-cron 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/VERSION +1 -1
- data/lib/sidekiq/cron/job.rb +29 -14
- data/lib/sidekiq/cron/locales/de.yml +1 -0
- data/lib/sidekiq/cron/locales/en.yml +2 -1
- data/lib/sidekiq/cron/locales/ru.yml +14 -0
- data/lib/sidekiq/cron/views/cron.erb +1 -1
- data/sidekiq-cron.gemspec +66 -65
- data/test/test_helper.rb +2 -0
- data/test/unit/job_test.rb +12 -2
- data/test/unit/{web_extesion_test.rb → web_extension_test.rb} +0 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8adf66042c715b918d56ac413f033f713fb0cfb0
|
4
|
+
data.tar.gz: 44d64bdf7d9e1329510fece42e186c35776ed85d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e0b4a1f7cd40f4e4db9d15ebc37cebb2afbf1249b8107be50557e72f93f8100da2c85bb1349a8125de0ba529b77c17c17ca7ff077883118c9cb655f33f5f4e9
|
7
|
+
data.tar.gz: 3487319de6f4626be8704a91f5767ba24505e88385b06b9df43b6818451dcc90e8246c110c1084d290e9fbfabe8d44831b8949f4277c80c1393287639f7714e4
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
Sidekiq-Cron [![Gem Version](https://badge.fury.io/rb/sidekiq-cron.
|
1
|
+
Sidekiq-Cron [![Gem Version](https://badge.fury.io/rb/sidekiq-cron.svg)](http://badge.fury.io/rb/sidekiq-cron) [![Build Status](https://travis-ci.org/ondrejbartas/sidekiq-cron.svg?branch=master)](https://travis-ci.org/ondrejbartas/sidekiq-cron) [![Coverage Status](https://coveralls.io/repos/ondrejbartas/sidekiq-cron/badge.svg?branch=master)](https://coveralls.io/r/ondrejbartas/sidekiq-cron?branch=master)
|
2
2
|
================================================================================================================================================================================================================================================================================================================================================================================================================================================
|
3
3
|
|
4
|
+
[![Join the chat at https://gitter.im/ondrejbartas/sidekiq-cron](https://badges.gitter.im/ondrejbartas/sidekiq-cron.svg)](https://gitter.im/ondrejbartas/sidekiq-cron?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
5
|
|
5
6
|
A scheduling add-on for [Sidekiq](http://sidekiq.org).
|
6
7
|
|
@@ -52,7 +53,8 @@ _Job properties_:
|
|
52
53
|
'queue' => 'name of queue',
|
53
54
|
'args' => '[Array or Hash] of arguments which will be passed to perform method',
|
54
55
|
'active_job' => true, # enqueue job through rails 4.2+ active job interface
|
55
|
-
'queue_name_prefix' => 'prefix' # rails 4.2+ active job queue with prefix
|
56
|
+
'queue_name_prefix' => 'prefix', # rails 4.2+ active job queue with prefix
|
57
|
+
'queue_name_delimiter' => '.' # rails 4.2+ active job queue with custom delimiter
|
56
58
|
}
|
57
59
|
```
|
58
60
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/sidekiq/cron/job.rb
CHANGED
@@ -72,10 +72,18 @@ module Sidekiq
|
|
72
72
|
# active job has different structure how it is loading data from sidekiq
|
73
73
|
# queue, it createaswrapper arround job
|
74
74
|
def active_job_message
|
75
|
+
if !"#{@active_job_queue_name_delimiter}".empty?
|
76
|
+
queue_name_delimiter = @active_job_queue_name_delimiter
|
77
|
+
elsif defined?(ActiveJob::Base) && defined?(ActiveJob::Base.queue_name_delimiter) && !ActiveJob::Base.queue_name_delimiter.empty?
|
78
|
+
queue_name_delimiter = ActiveJob::Base.queue_name_delimiter
|
79
|
+
else
|
80
|
+
queue_name_delimiter = '_'
|
81
|
+
end
|
82
|
+
|
75
83
|
if !"#{@active_job_queue_name_prefix}".empty?
|
76
|
-
queue_name = "#{@active_job_queue_name_prefix}
|
84
|
+
queue_name = "#{@active_job_queue_name_prefix}#{queue_name_delimiter}#{@queue}"
|
77
85
|
elsif defined?(ActiveJob::Base) && defined?(ActiveJob::Base.queue_name_prefix) && !"#{ActiveJob::Base.queue_name_prefix}".empty?
|
78
|
-
queue_name = "#{ActiveJob::Base.queue_name_prefix}
|
86
|
+
queue_name = "#{ActiveJob::Base.queue_name_prefix}#{queue_name_delimiter}#{@queue}"
|
79
87
|
else
|
80
88
|
queue_name = @queue
|
81
89
|
end
|
@@ -159,17 +167,19 @@ module Sidekiq
|
|
159
167
|
|
160
168
|
# get all cron jobs
|
161
169
|
def self.all
|
162
|
-
|
170
|
+
job_hashes = nil
|
163
171
|
Sidekiq.redis do |conn|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
nil
|
172
|
+
set_members = conn.smembers(jobs_key)
|
173
|
+
job_hashes = conn.pipelined do
|
174
|
+
set_members.each do |key|
|
175
|
+
conn.hgetall(key)
|
169
176
|
end
|
170
177
|
end
|
171
178
|
end
|
172
|
-
|
179
|
+
job_hashes.compact.reject(&:empty?).collect do |h|
|
180
|
+
# no need to fetch missing args from redis since we just got this hash from there
|
181
|
+
Sidekiq::Cron::Job.new(h.merge(fetch_missing_args: false))
|
182
|
+
end
|
173
183
|
end
|
174
184
|
|
175
185
|
def self.count
|
@@ -211,10 +221,12 @@ module Sidekiq
|
|
211
221
|
end
|
212
222
|
|
213
223
|
attr_accessor :name, :cron, :description, :klass, :args, :message
|
214
|
-
attr_reader :last_enqueue_time
|
224
|
+
attr_reader :last_enqueue_time, :fetch_missing_args
|
215
225
|
|
216
226
|
def initialize input_args = {}
|
217
227
|
args = input_args.stringify_keys
|
228
|
+
@fetch_missing_args = args.delete('fetch_missing_args')
|
229
|
+
@fetch_missing_args = true if @fetch_missing_args.nil?
|
218
230
|
|
219
231
|
@name = args["name"]
|
220
232
|
@cron = args["cron"]
|
@@ -238,6 +250,7 @@ module Sidekiq
|
|
238
250
|
|
239
251
|
@active_job = args["active_job"] == true || ("#{args["active_job"]}" =~ (/^(true|t|yes|y|1)$/i)) == 0 || false
|
240
252
|
@active_job_queue_name_prefix = args["queue_name_prefix"]
|
253
|
+
@active_job_queue_name_delimiter = args["queue_name_delimiter"]
|
241
254
|
|
242
255
|
if args["message"]
|
243
256
|
@message = args["message"]
|
@@ -302,9 +315,10 @@ module Sidekiq
|
|
302
315
|
|
303
316
|
def status_from_redis
|
304
317
|
out = "enabled"
|
305
|
-
if
|
318
|
+
if fetch_missing_args
|
306
319
|
Sidekiq.redis do |conn|
|
307
|
-
|
320
|
+
status = conn.hget redis_key, "status"
|
321
|
+
out = status if status
|
308
322
|
end
|
309
323
|
end
|
310
324
|
out
|
@@ -312,7 +326,7 @@ module Sidekiq
|
|
312
326
|
|
313
327
|
def last_enqueue_time_from_redis
|
314
328
|
out = nil
|
315
|
-
if
|
329
|
+
if fetch_missing_args
|
316
330
|
Sidekiq.redis do |conn|
|
317
331
|
out = Time.parse(conn.hget(redis_key, "last_enqueue_time")) rescue nil
|
318
332
|
end
|
@@ -332,6 +346,7 @@ module Sidekiq
|
|
332
346
|
status: @status,
|
333
347
|
active_job: @active_job,
|
334
348
|
queue_name_prefix: @active_job_queue_name_prefix,
|
349
|
+
queue_name_delimiter: @active_job_queue_name_delimiter,
|
335
350
|
last_enqueue_time: @last_enqueue_time,
|
336
351
|
}
|
337
352
|
end
|
@@ -399,7 +414,7 @@ module Sidekiq
|
|
399
414
|
|
400
415
|
#add information about last time! - don't enque right after scheduler poller starts!
|
401
416
|
time = Time.now
|
402
|
-
conn.zadd(job_enqueued_key, time.to_f.to_s, formated_last_time(time).to_s)
|
417
|
+
conn.zadd(job_enqueued_key, time.to_f.to_s, formated_last_time(time).to_s) unless conn.exists(job_enqueued_key)
|
403
418
|
end
|
404
419
|
logger.info { "Cron Jobs - add job with name: #{@name}" }
|
405
420
|
end
|
@@ -3,9 +3,10 @@ en:
|
|
3
3
|
Cron: Cron
|
4
4
|
CronJobs: Cron Jobs
|
5
5
|
EnqueueNow: Enqueue Now
|
6
|
+
'Cron string': Cron
|
6
7
|
AreYouSureDeleteCronJob: Are you sure you want to delete the %{job} cron job?
|
7
8
|
NoCronJobsFound: "No cron jobs found"
|
8
|
-
Enable:
|
9
|
+
Enable: Enable
|
9
10
|
Disable: Disable
|
10
11
|
'Last enque': Last enqueued
|
11
12
|
disabled: disabled
|
@@ -0,0 +1,14 @@
|
|
1
|
+
ru:
|
2
|
+
Job: Задача
|
3
|
+
Cron: Cron
|
4
|
+
CronJobs: Периодические задачи
|
5
|
+
Name: Название
|
6
|
+
'Cron string': Периодичность (синтаксис Cron)
|
7
|
+
EnqueueNow: Запустить
|
8
|
+
AreYouSureDeleteCronJob: Вы действительно хотите удалить задачу «%{job}»?
|
9
|
+
NoCronJobsFound: "Не найдено периодических задач"
|
10
|
+
Enable: Включить
|
11
|
+
Disable: Отключить
|
12
|
+
'Last enque': Последний запуск
|
13
|
+
disabled: отключено
|
14
|
+
enabled: включено
|
data/sidekiq-cron.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sidekiq-cron 0.4.
|
5
|
+
# stub: sidekiq-cron 0.4.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "sidekiq-cron"
|
9
|
-
s.version = "0.4.
|
8
|
+
s.name = "sidekiq-cron".freeze
|
9
|
+
s.version = "0.4.3"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Ondrej Bartas"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "Enables to set jobs to be run in specified time (using CRON notation)"
|
16
|
-
s.email = "ondrej@bartas.cz"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Ondrej Bartas".freeze]
|
14
|
+
s.date = "2016-08-18"
|
15
|
+
s.description = "Enables to set jobs to be run in specified time (using CRON notation)".freeze
|
16
|
+
s.email = "ondrej@bartas.cz".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.md"
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/sidekiq/cron/launcher.rb",
|
36
36
|
"lib/sidekiq/cron/locales/de.yml",
|
37
37
|
"lib/sidekiq/cron/locales/en.yml",
|
38
|
+
"lib/sidekiq/cron/locales/ru.yml",
|
38
39
|
"lib/sidekiq/cron/poller.rb",
|
39
40
|
"lib/sidekiq/cron/views/cron.erb",
|
40
41
|
"lib/sidekiq/cron/views/cron.slim",
|
@@ -44,71 +45,71 @@ Gem::Specification.new do |s|
|
|
44
45
|
"test/test_helper.rb",
|
45
46
|
"test/unit/job_test.rb",
|
46
47
|
"test/unit/poller_test.rb",
|
47
|
-
"test/unit/
|
48
|
+
"test/unit/web_extension_test.rb"
|
48
49
|
]
|
49
|
-
s.homepage = "http://github.com/ondrejbartas/sidekiq-cron"
|
50
|
-
s.licenses = ["MIT"]
|
51
|
-
s.rubygems_version = "2.
|
52
|
-
s.summary = "Sidekiq Cron helps to add repeated scheduled jobs"
|
50
|
+
s.homepage = "http://github.com/ondrejbartas/sidekiq-cron".freeze
|
51
|
+
s.licenses = ["MIT".freeze]
|
52
|
+
s.rubygems_version = "2.6.6".freeze
|
53
|
+
s.summary = "Sidekiq Cron helps to add repeated scheduled jobs".freeze
|
53
54
|
|
54
55
|
if s.respond_to? :specification_version then
|
55
56
|
s.specification_version = 4
|
56
57
|
|
57
58
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
|
-
s.add_runtime_dependency(%q<sidekiq
|
59
|
-
s.add_runtime_dependency(%q<rufus-scheduler
|
60
|
-
s.add_runtime_dependency(%q<redis-namespace
|
61
|
-
s.add_development_dependency(%q<bundler
|
62
|
-
s.add_development_dependency(%q<simplecov
|
63
|
-
s.add_development_dependency(%q<shoulda-context
|
64
|
-
s.add_development_dependency(%q<rack
|
65
|
-
s.add_development_dependency(%q<rack-test
|
66
|
-
s.add_development_dependency(%q<jeweler
|
67
|
-
s.add_development_dependency(%q<minitest
|
68
|
-
s.add_development_dependency(%q<test-unit
|
69
|
-
s.add_development_dependency(%q<sdoc
|
70
|
-
s.add_development_dependency(%q<slim
|
71
|
-
s.add_development_dependency(%q<sinatra
|
72
|
-
s.add_development_dependency(%q<mocha
|
73
|
-
s.add_development_dependency(%q<coveralls
|
74
|
-
s.add_development_dependency(%q<shotgun
|
59
|
+
s.add_runtime_dependency(%q<sidekiq>.freeze, [">= 4.0.0"])
|
60
|
+
s.add_runtime_dependency(%q<rufus-scheduler>.freeze, [">= 2.0.24"])
|
61
|
+
s.add_runtime_dependency(%q<redis-namespace>.freeze, [">= 1.5.2"])
|
62
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
64
|
+
s.add_development_dependency(%q<shoulda-context>.freeze, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<rack>.freeze, [">= 0"])
|
66
|
+
s.add_development_dependency(%q<rack-test>.freeze, [">= 0"])
|
67
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 1.8.3"])
|
68
|
+
s.add_development_dependency(%q<minitest>.freeze, [">= 0"])
|
69
|
+
s.add_development_dependency(%q<test-unit>.freeze, [">= 0"])
|
70
|
+
s.add_development_dependency(%q<sdoc>.freeze, [">= 0"])
|
71
|
+
s.add_development_dependency(%q<slim>.freeze, [">= 0"])
|
72
|
+
s.add_development_dependency(%q<sinatra>.freeze, [">= 0"])
|
73
|
+
s.add_development_dependency(%q<mocha>.freeze, [">= 0"])
|
74
|
+
s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
|
75
|
+
s.add_development_dependency(%q<shotgun>.freeze, [">= 0"])
|
75
76
|
else
|
76
|
-
s.add_dependency(%q<sidekiq
|
77
|
-
s.add_dependency(%q<rufus-scheduler
|
78
|
-
s.add_dependency(%q<redis-namespace
|
79
|
-
s.add_dependency(%q<bundler
|
80
|
-
s.add_dependency(%q<simplecov
|
81
|
-
s.add_dependency(%q<shoulda-context
|
82
|
-
s.add_dependency(%q<rack
|
83
|
-
s.add_dependency(%q<rack-test
|
84
|
-
s.add_dependency(%q<jeweler
|
85
|
-
s.add_dependency(%q<minitest
|
86
|
-
s.add_dependency(%q<test-unit
|
87
|
-
s.add_dependency(%q<sdoc
|
88
|
-
s.add_dependency(%q<slim
|
89
|
-
s.add_dependency(%q<sinatra
|
90
|
-
s.add_dependency(%q<mocha
|
91
|
-
s.add_dependency(%q<coveralls
|
92
|
-
s.add_dependency(%q<shotgun
|
77
|
+
s.add_dependency(%q<sidekiq>.freeze, [">= 4.0.0"])
|
78
|
+
s.add_dependency(%q<rufus-scheduler>.freeze, [">= 2.0.24"])
|
79
|
+
s.add_dependency(%q<redis-namespace>.freeze, [">= 1.5.2"])
|
80
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
81
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
82
|
+
s.add_dependency(%q<shoulda-context>.freeze, [">= 0"])
|
83
|
+
s.add_dependency(%q<rack>.freeze, [">= 0"])
|
84
|
+
s.add_dependency(%q<rack-test>.freeze, [">= 0"])
|
85
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 1.8.3"])
|
86
|
+
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
87
|
+
s.add_dependency(%q<test-unit>.freeze, [">= 0"])
|
88
|
+
s.add_dependency(%q<sdoc>.freeze, [">= 0"])
|
89
|
+
s.add_dependency(%q<slim>.freeze, [">= 0"])
|
90
|
+
s.add_dependency(%q<sinatra>.freeze, [">= 0"])
|
91
|
+
s.add_dependency(%q<mocha>.freeze, [">= 0"])
|
92
|
+
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
|
93
|
+
s.add_dependency(%q<shotgun>.freeze, [">= 0"])
|
93
94
|
end
|
94
95
|
else
|
95
|
-
s.add_dependency(%q<sidekiq
|
96
|
-
s.add_dependency(%q<rufus-scheduler
|
97
|
-
s.add_dependency(%q<redis-namespace
|
98
|
-
s.add_dependency(%q<bundler
|
99
|
-
s.add_dependency(%q<simplecov
|
100
|
-
s.add_dependency(%q<shoulda-context
|
101
|
-
s.add_dependency(%q<rack
|
102
|
-
s.add_dependency(%q<rack-test
|
103
|
-
s.add_dependency(%q<jeweler
|
104
|
-
s.add_dependency(%q<minitest
|
105
|
-
s.add_dependency(%q<test-unit
|
106
|
-
s.add_dependency(%q<sdoc
|
107
|
-
s.add_dependency(%q<slim
|
108
|
-
s.add_dependency(%q<sinatra
|
109
|
-
s.add_dependency(%q<mocha
|
110
|
-
s.add_dependency(%q<coveralls
|
111
|
-
s.add_dependency(%q<shotgun
|
96
|
+
s.add_dependency(%q<sidekiq>.freeze, [">= 4.0.0"])
|
97
|
+
s.add_dependency(%q<rufus-scheduler>.freeze, [">= 2.0.24"])
|
98
|
+
s.add_dependency(%q<redis-namespace>.freeze, [">= 1.5.2"])
|
99
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
100
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
101
|
+
s.add_dependency(%q<shoulda-context>.freeze, [">= 0"])
|
102
|
+
s.add_dependency(%q<rack>.freeze, [">= 0"])
|
103
|
+
s.add_dependency(%q<rack-test>.freeze, [">= 0"])
|
104
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 1.8.3"])
|
105
|
+
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
106
|
+
s.add_dependency(%q<test-unit>.freeze, [">= 0"])
|
107
|
+
s.add_dependency(%q<sdoc>.freeze, [">= 0"])
|
108
|
+
s.add_dependency(%q<slim>.freeze, [">= 0"])
|
109
|
+
s.add_dependency(%q<sinatra>.freeze, [">= 0"])
|
110
|
+
s.add_dependency(%q<mocha>.freeze, [">= 0"])
|
111
|
+
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
|
112
|
+
s.add_dependency(%q<shotgun>.freeze, [">= 0"])
|
112
113
|
end
|
113
114
|
end
|
114
115
|
|
data/test/test_helper.rb
CHANGED
data/test/unit/job_test.rb
CHANGED
@@ -835,6 +835,16 @@ describe "Cron Job" do
|
|
835
835
|
refute Sidekiq::Cron::Job.new(@args.merge(cron: "0 1,13 * * *")).should_enque? @time
|
836
836
|
end
|
837
837
|
|
838
|
+
it 'doesnt skip enqueuing if job is resaved near next enqueue time' do
|
839
|
+
job = Sidekiq::Cron::Job.new(@args)
|
840
|
+
assert job.test_and_enque_for_time!(@time), "should enqueue"
|
841
|
+
|
842
|
+
future_now = @time + 1 * 60 * 60
|
843
|
+
Time.stubs(:now).returns(future_now) # save uses Time.now
|
844
|
+
job.save
|
845
|
+
assert Sidekiq::Cron::Job.new(@args).test_and_enque_for_time!(future_now + 30), "should enqueue"
|
846
|
+
end
|
847
|
+
|
838
848
|
it "remove old enque times + should be enqeued" do
|
839
849
|
job = Sidekiq::Cron::Job.new(@args)
|
840
850
|
assert_nil job.last_enqueue_time
|
@@ -843,7 +853,7 @@ describe "Cron Job" do
|
|
843
853
|
|
844
854
|
refute Sidekiq::Cron::Job.new(@args).test_and_enque_for_time!(@time), "should not enqueue"
|
845
855
|
Sidekiq.redis do |conn|
|
846
|
-
assert_equal conn.zcard(Sidekiq::Cron::Job.new(@args).send(:job_enqueued_key)),
|
856
|
+
assert_equal conn.zcard(Sidekiq::Cron::Job.new(@args).send(:job_enqueued_key)), 1, "Should have one enqueued job"
|
847
857
|
end
|
848
858
|
assert_equal Sidekiq::Queue.all.first.size, 1, "Sidekiq queue 1 job in queue"
|
849
859
|
|
@@ -852,7 +862,7 @@ describe "Cron Job" do
|
|
852
862
|
refute Sidekiq::Cron::Job.new(@args).test_and_enque_for_time! @time + 1 * 60 * 60
|
853
863
|
|
854
864
|
Sidekiq.redis do |conn|
|
855
|
-
assert_equal conn.zcard(Sidekiq::Cron::Job.new(@args).send(:job_enqueued_key)),
|
865
|
+
assert_equal conn.zcard(Sidekiq::Cron::Job.new(@args).send(:job_enqueued_key)), 2, "Should have two enqueued job"
|
856
866
|
end
|
857
867
|
assert_equal Sidekiq::Queue.all.first.size, 2, "Sidekiq queue 2 jobs in queue"
|
858
868
|
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondrej Bartas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -272,6 +272,7 @@ files:
|
|
272
272
|
- lib/sidekiq/cron/launcher.rb
|
273
273
|
- lib/sidekiq/cron/locales/de.yml
|
274
274
|
- lib/sidekiq/cron/locales/en.yml
|
275
|
+
- lib/sidekiq/cron/locales/ru.yml
|
275
276
|
- lib/sidekiq/cron/poller.rb
|
276
277
|
- lib/sidekiq/cron/views/cron.erb
|
277
278
|
- lib/sidekiq/cron/views/cron.slim
|
@@ -281,7 +282,7 @@ files:
|
|
281
282
|
- test/test_helper.rb
|
282
283
|
- test/unit/job_test.rb
|
283
284
|
- test/unit/poller_test.rb
|
284
|
-
- test/unit/
|
285
|
+
- test/unit/web_extension_test.rb
|
285
286
|
homepage: http://github.com/ondrejbartas/sidekiq-cron
|
286
287
|
licenses:
|
287
288
|
- MIT
|
@@ -302,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
303
|
version: '0'
|
303
304
|
requirements: []
|
304
305
|
rubyforge_project:
|
305
|
-
rubygems_version: 2.
|
306
|
+
rubygems_version: 2.6.6
|
306
307
|
signing_key:
|
307
308
|
specification_version: 4
|
308
309
|
summary: Sidekiq Cron helps to add repeated scheduled jobs
|