resque-scheduler 4.2.1 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of resque-scheduler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/rubocop.yml +27 -0
- data/.github/workflows/ruby.yml +48 -0
- data/AUTHORS.md +7 -0
- data/CHANGELOG.md +495 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/README.md +37 -17
- data/Rakefile +1 -5
- data/{bin → exe}/resque-scheduler +0 -0
- data/lib/resque/scheduler/cli.rb +1 -0
- data/lib/resque/scheduler/delaying_extensions.rb +38 -6
- data/lib/resque/scheduler/env.rb +8 -4
- data/lib/resque/scheduler/lock/resilient.rb +19 -12
- data/lib/resque/scheduler/locking.rb +2 -2
- data/lib/resque/scheduler/scheduling_extensions.rb +4 -3
- data/lib/resque/scheduler/server/views/delayed.erb +1 -1
- data/lib/resque/scheduler/server/views/search_form.erb +1 -1
- data/lib/resque/scheduler/server.rb +1 -1
- data/lib/resque/scheduler/version.rb +1 -1
- data/lib/resque/scheduler.rb +39 -16
- data/resque-scheduler.gemspec +29 -10
- metadata +62 -66
- data/.gitignore +0 -17
- data/.rubocop.yml +0 -18
- data/.rubocop_todo.yml +0 -71
- data/.simplecov +0 -3
- data/.travis.yml +0 -26
- data/.vagrant-provision-as-vagrant.sh +0 -15
- data/.vagrant-provision.sh +0 -23
- data/.vagrant-skel/bash_profile +0 -7
- data/.vagrant-skel/bashrc +0 -7
- data/HISTORY.md +0 -303
- data/Vagrantfile +0 -14
- data/examples/Rakefile +0 -2
- data/examples/config/initializers/resque-web.rb +0 -37
- data/examples/dynamic-scheduling/README.md +0 -28
- data/examples/dynamic-scheduling/app/jobs/fix_schedules_job.rb +0 -52
- data/examples/dynamic-scheduling/app/jobs/send_email_job.rb +0 -9
- data/examples/dynamic-scheduling/app/models/user.rb +0 -16
- data/examples/dynamic-scheduling/config/resque.yml +0 -4
- data/examples/dynamic-scheduling/config/static_schedule.yml +0 -7
- data/examples/dynamic-scheduling/lib/tasks/resque.rake +0 -48
- data/examples/run-resque-web +0 -3
- data/script/migrate_to_timestamps_set.rb +0 -16
- data/tasks/resque_scheduler.rake +0 -2
- data/test/cli_test.rb +0 -231
- data/test/delayed_queue_test.rb +0 -925
- data/test/env_test.rb +0 -47
- data/test/multi_process_test.rb +0 -125
- data/test/resque-web_test.rb +0 -364
- data/test/scheduler_args_test.rb +0 -222
- data/test/scheduler_hooks_test.rb +0 -55
- data/test/scheduler_locking_test.rb +0 -316
- data/test/scheduler_setup_test.rb +0 -141
- data/test/scheduler_task_test.rb +0 -72
- data/test/scheduler_test.rb +0 -473
- data/test/test_helper.rb +0 -147
- data/test/util_test.rb +0 -17
data/test/test_helper.rb
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
# vim:fileencoding=utf-8
|
2
|
-
require 'simplecov'
|
3
|
-
|
4
|
-
require 'test/unit'
|
5
|
-
require 'minitest'
|
6
|
-
require 'mocha/setup'
|
7
|
-
require 'rack/test'
|
8
|
-
require 'resque'
|
9
|
-
|
10
|
-
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'
|
11
|
-
require 'resque-scheduler'
|
12
|
-
require 'resque/scheduler/server'
|
13
|
-
|
14
|
-
##
|
15
|
-
# test/spec/mini 3
|
16
|
-
# original work: http://gist.github.com/25455
|
17
|
-
# forked and modified: https://gist.github.com/meatballhat/8906709
|
18
|
-
#
|
19
|
-
def context(*args, &block)
|
20
|
-
return super unless (name = args.first) && block
|
21
|
-
require 'test/unit'
|
22
|
-
klass = Class.new(Test::Unit::TestCase) do
|
23
|
-
def self.test(name, &block)
|
24
|
-
define_method("test_#{name.gsub(/\W/, '_')}", &block) if block
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.xtest(*_args)
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.setup(&block)
|
31
|
-
define_method(:setup, &block)
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.teardown(&block)
|
35
|
-
define_method(:teardown, &block)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
(class << klass; self end).send(:define_method, :name) do
|
39
|
-
name.gsub(/\W/, '_')
|
40
|
-
end
|
41
|
-
klass.class_eval(&block)
|
42
|
-
end
|
43
|
-
|
44
|
-
unless defined?(Rails)
|
45
|
-
module Rails
|
46
|
-
class << self
|
47
|
-
attr_accessor :env
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
class ExceptionHandlerClass
|
53
|
-
def self.on_enqueue_failure(_, _); end
|
54
|
-
end
|
55
|
-
|
56
|
-
class FakeCustomJobClass
|
57
|
-
def self.scheduled(_, _, *_); end
|
58
|
-
end
|
59
|
-
|
60
|
-
class FakeCustomJobClassEnqueueAt
|
61
|
-
@queue = :test
|
62
|
-
def self.scheduled(_, _, *_); end
|
63
|
-
end
|
64
|
-
|
65
|
-
class SomeJob
|
66
|
-
def self.perform(_, _)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
class SomeIvarJob < SomeJob
|
71
|
-
@queue = :ivar
|
72
|
-
end
|
73
|
-
|
74
|
-
class SomeFancyJob < SomeJob
|
75
|
-
def self.queue
|
76
|
-
:fancy
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
class SomeSharedEnvJob < SomeJob
|
81
|
-
def self.queue
|
82
|
-
:shared_job
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
class SomeQuickJob < SomeJob
|
87
|
-
@queue = :quick
|
88
|
-
end
|
89
|
-
|
90
|
-
class SomeRealClass
|
91
|
-
def self.queue
|
92
|
-
:some_real_queue
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
class SomeJobWithResqueHooks < SomeRealClass
|
97
|
-
def before_enqueue_example; end
|
98
|
-
|
99
|
-
def after_enqueue_example; end
|
100
|
-
end
|
101
|
-
|
102
|
-
class JobWithParams
|
103
|
-
def self.perform(*args)
|
104
|
-
@args = args
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
JobWithoutParams = Class.new(JobWithParams)
|
109
|
-
|
110
|
-
%w(
|
111
|
-
APP_NAME
|
112
|
-
DYNAMIC_SCHEDULE
|
113
|
-
LOGFILE
|
114
|
-
LOGFORMAT
|
115
|
-
QUIET
|
116
|
-
RAILS_ENV
|
117
|
-
RESQUE_SCHEDULER_INTERVAL
|
118
|
-
VERBOSE
|
119
|
-
).each do |envvar|
|
120
|
-
ENV[envvar] = nil
|
121
|
-
end
|
122
|
-
|
123
|
-
def nullify_logger
|
124
|
-
Resque::Scheduler.configure do |c|
|
125
|
-
c.quiet = nil
|
126
|
-
c.verbose = nil
|
127
|
-
c.logfile = nil
|
128
|
-
c.logger = nil
|
129
|
-
end
|
130
|
-
|
131
|
-
ENV['LOGFILE'] = nil
|
132
|
-
end
|
133
|
-
|
134
|
-
def restore_devnull_logfile
|
135
|
-
nullify_logger
|
136
|
-
ENV['LOGFILE'] = '/dev/null'
|
137
|
-
end
|
138
|
-
|
139
|
-
def with_failure_handler(handler)
|
140
|
-
original_handler = Resque::Scheduler.failure_handler
|
141
|
-
Resque::Scheduler.failure_handler = handler
|
142
|
-
yield
|
143
|
-
ensure
|
144
|
-
Resque::Scheduler.failure_handler = original_handler
|
145
|
-
end
|
146
|
-
|
147
|
-
restore_devnull_logfile
|
data/test/util_test.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# vim:fileencoding=utf-8
|
2
|
-
|
3
|
-
context 'Util' do
|
4
|
-
def util
|
5
|
-
Resque::Scheduler::Util
|
6
|
-
end
|
7
|
-
|
8
|
-
test 'constantizing' do
|
9
|
-
assert util.constantize('Resque::Scheduler') == Resque::Scheduler
|
10
|
-
end
|
11
|
-
|
12
|
-
module ReSchedulIzer; end
|
13
|
-
|
14
|
-
test 'constantizing with a dash' do
|
15
|
-
assert util.constantize('re-schedul-izer') == ReSchedulIzer
|
16
|
-
end
|
17
|
-
end
|