mcmire-delayed_job_web 1.1.3.rc3 → 1.1.3.rc4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +10 -11
- data/VERSION +1 -1
- data/lib/delayed_job_web/application/app.rb +11 -2
- data/lib/delayed_job_web/application/public/javascripts/application.js +4 -0
- data/lib/delayed_job_web/application/views/enqueued.haml +4 -2
- data/lib/delayed_job_web/application/views/failed.haml +1 -1
- data/lib/delayed_job_web/application/views/pending.haml +2 -2
- data/lib/delayed_job_web/application/views/working.haml +1 -1
- data/mcmire-delayed_job_web.gemspec +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
About
|
1
|
+
About This Fork
|
2
2
|
===============
|
3
3
|
|
4
|
-
This fork by [@mcmire][2] adds Rails 2.x support, and also
|
5
|
-
"enqueued" tab
|
6
|
-
the README below.
|
4
|
+
This fork by [@mcmire][2] adds Rails 2.x support, and also repurposes the
|
5
|
+
"enqueued" tab as an "all jobs" tab. I also updated the README below.
|
7
6
|
|
8
7
|
---
|
9
8
|
|
@@ -15,33 +14,33 @@ written to work with Rails 2 and 3 applications using activerecord.
|
|
15
14
|
|
16
15
|
Some features:
|
17
16
|
|
18
|
-
* Easily view pending, working, and
|
17
|
+
* Easily view pending, working, failed, and all jobs.
|
19
18
|
* Queue any single job, or all pending jobs, to run immediately.
|
20
19
|
* Remove a failed job, or easily remove all failed jobs.
|
21
20
|
|
22
21
|
Quick Start For Rails 3 Applications
|
23
22
|
------------------------------------
|
24
23
|
|
25
|
-
Add the dependency to your Gemfile
|
24
|
+
Add the dependency to your Gemfile:
|
26
25
|
|
27
26
|
```ruby
|
28
27
|
gem "delayed_job_web"
|
29
28
|
```
|
30
29
|
|
31
|
-
Install it
|
30
|
+
Install it:
|
32
31
|
|
33
32
|
```ruby
|
34
33
|
bundle
|
35
34
|
```
|
36
35
|
|
37
|
-
Add a route to your application for accessing the interface
|
36
|
+
Add a route to your application for accessing the interface:
|
38
37
|
|
39
38
|
```ruby
|
40
|
-
|
39
|
+
mount DelayedJobWeb => '/delayed_job'
|
41
40
|
```
|
42
41
|
|
43
|
-
|
44
|
-
something like this your config.ru file
|
42
|
+
Finally, you'll probably want to password-protect the interface. An easy way to
|
43
|
+
do this is to add something like this to your config.ru file:
|
45
44
|
|
46
45
|
```ruby
|
47
46
|
if Rails.env.production?
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.3.
|
1
|
+
1.1.3.rc4
|
@@ -96,6 +96,11 @@ class DelayedJobWeb < Sinatra::Base
|
|
96
96
|
redirect back
|
97
97
|
end
|
98
98
|
|
99
|
+
post "/clear" do
|
100
|
+
remove_jobs
|
101
|
+
redirect back
|
102
|
+
end
|
103
|
+
|
99
104
|
def find_all_jobs(type, opts={})
|
100
105
|
conditions = delayed_job_sql(type)
|
101
106
|
if Rails.version.to_s =~ /^2/
|
@@ -133,8 +138,12 @@ class DelayedJobWeb < Sinatra::Base
|
|
133
138
|
find_job(id).delete
|
134
139
|
end
|
135
140
|
|
136
|
-
def remove_jobs(type)
|
137
|
-
|
141
|
+
def remove_jobs(type=nil)
|
142
|
+
if type
|
143
|
+
delayed_job.destroy_all(delayed_job_sql(type))
|
144
|
+
else
|
145
|
+
delayed_job.destroy_all
|
146
|
+
end
|
138
147
|
end
|
139
148
|
|
140
149
|
def requeue_failed_jobs
|
@@ -1,5 +1,7 @@
|
|
1
|
-
%h1
|
2
|
-
|
1
|
+
%h1 All Jobs
|
2
|
+
- if @jobs.any?
|
3
|
+
%form{:method => 'POST', :action => u('clear')}
|
4
|
+
%input{:type => 'submit', :value => 'Clear All Jobs', :class => 'btn confirm', :'data-message' => 'Are you sure you want to clear all jobs? This cannot be undone.'}
|
3
5
|
%p.sub
|
4
6
|
The list below contains all jobs which are in the delayed_jobs table.
|
5
7
|
%p.sub
|
@@ -1,7 +1,7 @@
|
|
1
1
|
%h1 Failed Jobs
|
2
2
|
- if @jobs.any?
|
3
3
|
%form{:method => 'POST', :action => u('failed/clear')}
|
4
|
-
%input{:type => 'submit', :value => 'Clear Failed Jobs'}
|
4
|
+
%input{:type => 'submit', :value => 'Clear Failed Jobs', :class => 'btn confirm', :'data-message' => 'Are you sure you want to clear all failed jobs? This cannot be undone.'}
|
5
5
|
%form{:method => 'POST', :action => u('requeue/all')}
|
6
6
|
%input{:type => 'submit', :value => 'Retry Failed Jobs'}
|
7
7
|
|
@@ -2,9 +2,9 @@
|
|
2
2
|
Pending
|
3
3
|
- if @jobs.any?
|
4
4
|
%form{:method => 'POST', :action => u('requeue/all')}
|
5
|
-
%input{:type => 'submit', :value => '
|
5
|
+
%input{:type => 'submit', :value => 'Re-enqueue Pending Jobs'}
|
6
6
|
%p.sub
|
7
|
-
The list below contains jobs which are waiting to be
|
7
|
+
The list below contains jobs which are waiting to be run.
|
8
8
|
%p.sub= "Showing #{start} to #{start + per_page} of #{@all_jobs.count} pending jobs."
|
9
9
|
%ul.job
|
10
10
|
- @jobs.each do |job|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mcmire-delayed_job_web}
|
8
|
-
s.version = "1.1.3.
|
8
|
+
s.version = "1.1.3.rc4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Erick Schmitt", "Elliot Winkler"]
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mcmire-delayed_job_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424053
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
9
|
- 3
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 1.1.3.
|
11
|
+
- 4
|
12
|
+
version: 1.1.3.rc4
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Erick Schmitt
|