resque-scheduler 2.5.1 → 4.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/dependabot.yml +12 -0
- data/.github/funding.yml +4 -0
- data/.github/workflows/codeql-analysis.yml +59 -0
- data/.github/workflows/rubocop.yml +27 -0
- data/.github/workflows/ruby.yml +81 -0
- data/AUTHORS.md +25 -0
- data/CHANGELOG.md +539 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +26 -2
- data/README.md +291 -70
- data/Rakefile +8 -19
- data/exe/resque-scheduler +5 -0
- data/lib/resque/scheduler/cli.rb +147 -0
- data/lib/resque/scheduler/configuration.rb +102 -0
- data/lib/resque/scheduler/delaying_extensions.rb +371 -0
- data/lib/resque/scheduler/env.rb +85 -0
- data/lib/resque/scheduler/extension.rb +13 -0
- data/lib/resque/scheduler/failure_handler.rb +11 -0
- data/lib/resque/scheduler/lock/base.rb +13 -4
- data/lib/resque/scheduler/lock/basic.rb +4 -5
- data/lib/resque/scheduler/lock/resilient.rb +52 -43
- data/lib/resque/scheduler/lock.rb +2 -1
- data/lib/resque/scheduler/locking.rb +104 -0
- data/lib/resque/scheduler/logger_builder.rb +83 -0
- data/lib/resque/scheduler/plugin.rb +31 -0
- data/lib/resque/scheduler/scheduling_extensions.rb +142 -0
- data/lib/{resque_scheduler → resque/scheduler}/server/views/delayed.erb +21 -12
- data/lib/{resque_scheduler → resque/scheduler}/server/views/delayed_schedules.erb +1 -1
- data/lib/{resque_scheduler → resque/scheduler}/server/views/delayed_timestamp.erb +1 -1
- data/lib/resque/scheduler/server/views/scheduler.erb +58 -0
- data/lib/{resque_scheduler → resque/scheduler}/server/views/search.erb +4 -7
- data/lib/{resque_scheduler → resque/scheduler}/server/views/search_form.erb +1 -5
- data/lib/resque/scheduler/server.rb +268 -0
- data/lib/resque/scheduler/signal_handling.rb +40 -0
- data/lib/{resque_scheduler → resque/scheduler}/tasks.rb +3 -6
- data/lib/resque/scheduler/util.rb +39 -0
- data/lib/resque/scheduler/version.rb +7 -0
- data/lib/resque/scheduler.rb +271 -199
- data/lib/resque-scheduler.rb +3 -1
- data/resque-scheduler.gemspec +53 -20
- metadata +176 -132
- data/.gitignore +0 -11
- data/.rubocop.yml +0 -129
- data/.simplecov +0 -1
- data/.travis.yml +0 -21
- data/HISTORY.md +0 -226
- data/ROADMAP.md +0 -10
- data/bin/resque-scheduler +0 -5
- 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 -54
- 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/lib/resque/scheduler_locking.rb +0 -91
- data/lib/resque_scheduler/cli.rb +0 -160
- data/lib/resque_scheduler/logger_builder.rb +0 -70
- data/lib/resque_scheduler/plugin.rb +0 -28
- data/lib/resque_scheduler/server/views/scheduler.erb +0 -36
- data/lib/resque_scheduler/server.rb +0 -182
- data/lib/resque_scheduler/util.rb +0 -34
- data/lib/resque_scheduler/version.rb +0 -5
- data/lib/resque_scheduler.rb +0 -386
- data/script/migrate_to_timestamps_set.rb +0 -14
- data/tasks/resque_scheduler.rake +0 -2
- data/test/cli_test.rb +0 -286
- data/test/delayed_queue_test.rb +0 -449
- data/test/redis-test.conf +0 -108
- data/test/resque-web_test.rb +0 -199
- data/test/scheduler_args_test.rb +0 -190
- data/test/scheduler_hooks_test.rb +0 -23
- data/test/scheduler_locking_test.rb +0 -242
- data/test/scheduler_setup_test.rb +0 -95
- data/test/scheduler_task_test.rb +0 -35
- data/test/scheduler_test.rb +0 -344
- data/test/support/redis_instance.rb +0 -134
- data/test/test_helper.rb +0 -131
- /data/lib/{resque_scheduler → resque/scheduler}/server/views/requeue-params.erb +0 -0
data/test/test_helper.rb
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
# Pretty much copied this file from the resque test_helper since we want
|
2
|
-
# to do all the same stuff
|
3
|
-
|
4
|
-
dir = File.dirname(File.expand_path(__FILE__))
|
5
|
-
|
6
|
-
require 'rubygems'
|
7
|
-
require 'bundler/setup'
|
8
|
-
|
9
|
-
require 'simplecov' unless RUBY_VERSION < '1.9'
|
10
|
-
|
11
|
-
require 'test/unit'
|
12
|
-
require 'mocha/setup'
|
13
|
-
require 'resque'
|
14
|
-
|
15
|
-
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'
|
16
|
-
require 'resque_scheduler'
|
17
|
-
require 'resque_scheduler/server'
|
18
|
-
|
19
|
-
unless ENV['RESQUE_SCHEDULER_DISABLE_TEST_REDIS_SERVER']
|
20
|
-
# Start our own Redis when the tests start. RedisInstance will take care of
|
21
|
-
# starting and stopping.
|
22
|
-
require File.expand_path('../support/redis_instance', __FILE__)
|
23
|
-
RedisInstance.run!
|
24
|
-
end
|
25
|
-
|
26
|
-
at_exit do
|
27
|
-
next if $!
|
28
|
-
|
29
|
-
if defined?(MiniTest)
|
30
|
-
exit_code = MiniTest::Unit.new.run(ARGV)
|
31
|
-
else
|
32
|
-
exit_code = Test::Unit::AutoRunner.run
|
33
|
-
end
|
34
|
-
|
35
|
-
exit(exit_code || 0)
|
36
|
-
end
|
37
|
-
|
38
|
-
##
|
39
|
-
# test/spec/mini 3
|
40
|
-
# http://gist.github.com/25455
|
41
|
-
# chris@ozmm.org
|
42
|
-
#
|
43
|
-
def context(*args, &block)
|
44
|
-
return super unless (name = args.first) && block
|
45
|
-
require 'test/unit'
|
46
|
-
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
|
47
|
-
def self.test(name, &block)
|
48
|
-
define_method("test_#{name.gsub(/\W/,'_')}", &block) if block
|
49
|
-
end
|
50
|
-
def self.xtest(*args) end
|
51
|
-
def self.setup(&block) define_method(:setup, &block) end
|
52
|
-
def self.teardown(&block) define_method(:teardown, &block) end
|
53
|
-
end
|
54
|
-
(class << klass; self end).send(:define_method, :name) { name.gsub(/\W/,'_') }
|
55
|
-
klass.class_eval(&block)
|
56
|
-
end
|
57
|
-
|
58
|
-
unless defined?(Rails)
|
59
|
-
module Rails
|
60
|
-
class << self
|
61
|
-
attr_accessor :env
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class FakeCustomJobClass
|
67
|
-
def self.scheduled(queue, klass, *args); end
|
68
|
-
end
|
69
|
-
|
70
|
-
class FakeCustomJobClassEnqueueAt
|
71
|
-
@queue = :test
|
72
|
-
def self.scheduled(queue, klass, *args); end
|
73
|
-
end
|
74
|
-
|
75
|
-
class SomeJob
|
76
|
-
def self.perform(repo_id, path)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
class SomeIvarJob < SomeJob
|
81
|
-
@queue = :ivar
|
82
|
-
end
|
83
|
-
|
84
|
-
class SomeQuickJob < SomeJob
|
85
|
-
@queue = :quick
|
86
|
-
end
|
87
|
-
|
88
|
-
class SomeRealClass
|
89
|
-
def self.queue
|
90
|
-
:some_real_queue
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
class JobWithParams
|
95
|
-
def self.perform(*args)
|
96
|
-
@args = args
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
JobWithoutParams = Class.new(JobWithParams)
|
101
|
-
|
102
|
-
%w(
|
103
|
-
APP_NAME
|
104
|
-
DYNAMIC_SCHEDULE
|
105
|
-
LOGFILE
|
106
|
-
LOGFORMAT
|
107
|
-
MUTE
|
108
|
-
RAILS_ENV
|
109
|
-
RESQUE_SCHEDULER_INTERVAL
|
110
|
-
VERBOSE
|
111
|
-
).each do |envvar|
|
112
|
-
ENV[envvar] = nil
|
113
|
-
end
|
114
|
-
|
115
|
-
def nullify_logger
|
116
|
-
Resque::Scheduler.configure do |c|
|
117
|
-
c.mute = nil
|
118
|
-
c.verbose = nil
|
119
|
-
c.logfile = nil
|
120
|
-
c.logger = nil
|
121
|
-
end
|
122
|
-
|
123
|
-
ENV['LOGFILE'] = nil
|
124
|
-
end
|
125
|
-
|
126
|
-
def restore_devnull_logfile
|
127
|
-
nullify_logger
|
128
|
-
ENV['LOGFILE'] = '/dev/null'
|
129
|
-
end
|
130
|
-
|
131
|
-
restore_devnull_logfile
|
File without changes
|