qless 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/install_phantomjs +7 -0
- data/lib/qless.rb +4 -0
- data/lib/qless/job.rb +40 -38
- data/lib/qless/qless-core/cancel.lua +9 -9
- data/lib/qless/qless-core/failed.lua +1 -1
- data/lib/qless/qless-core/peek.lua +22 -12
- data/lib/qless/qless-core/pop.lua +31 -16
- data/lib/qless/qless-core/recur.lua +12 -3
- data/lib/qless/server.rb +96 -66
- data/lib/qless/server/static/css/bootstrap-responsive.css +686 -0
- data/lib/qless/server/static/css/bootstrap-responsive.min.css +12 -0
- data/lib/qless/server/static/css/bootstrap.css +3991 -0
- data/lib/qless/server/static/css/bootstrap.min.css +689 -0
- data/lib/qless/server/static/css/codemirror.css +112 -0
- data/lib/qless/server/static/css/docs.css +819 -0
- data/lib/qless/server/static/css/jquery.noty.css +105 -0
- data/lib/qless/server/static/css/noty_theme_twitter.css +137 -0
- data/lib/qless/server/static/css/style.css +204 -0
- data/lib/qless/server/static/favicon.ico +0 -0
- data/lib/qless/server/static/img/glyphicons-halflings-white.png +0 -0
- data/lib/qless/server/static/img/glyphicons-halflings.png +0 -0
- data/lib/qless/server/static/js/bootstrap-alert.js +94 -0
- data/lib/qless/server/static/js/bootstrap-scrollspy.js +125 -0
- data/lib/qless/server/static/js/bootstrap-tab.js +130 -0
- data/lib/qless/server/static/js/bootstrap-tooltip.js +270 -0
- data/lib/qless/server/static/js/bootstrap-typeahead.js +285 -0
- data/lib/qless/server/static/js/bootstrap.js +1726 -0
- data/lib/qless/server/static/js/bootstrap.min.js +6 -0
- data/lib/qless/server/static/js/codemirror.js +2972 -0
- data/lib/qless/server/static/js/jquery.noty.js +220 -0
- data/lib/qless/server/static/js/mode/javascript.js +360 -0
- data/lib/qless/server/static/js/theme/cobalt.css +18 -0
- data/lib/qless/server/static/js/theme/eclipse.css +25 -0
- data/lib/qless/server/static/js/theme/elegant.css +10 -0
- data/lib/qless/server/static/js/theme/lesser-dark.css +45 -0
- data/lib/qless/server/static/js/theme/monokai.css +28 -0
- data/lib/qless/server/static/js/theme/neat.css +9 -0
- data/lib/qless/server/static/js/theme/night.css +21 -0
- data/lib/qless/server/static/js/theme/rubyblue.css +21 -0
- data/lib/qless/server/static/js/theme/xq-dark.css +46 -0
- data/lib/qless/server/views/_job.erb +219 -0
- data/lib/qless/server/views/_job_list.erb +8 -0
- data/lib/qless/server/views/_pagination.erb +7 -0
- data/lib/qless/server/views/about.erb +130 -0
- data/lib/qless/server/views/config.erb +14 -0
- data/lib/qless/server/views/failed.erb +48 -0
- data/lib/qless/server/views/failed_type.erb +18 -0
- data/lib/qless/server/views/job.erb +17 -0
- data/lib/qless/server/views/layout.erb +341 -0
- data/lib/qless/server/views/overview.erb +90 -0
- data/lib/qless/server/views/queue.erb +122 -0
- data/lib/qless/server/views/queues.erb +26 -0
- data/lib/qless/server/views/tag.erb +6 -0
- data/lib/qless/server/views/track.erb +69 -0
- data/lib/qless/server/views/worker.erb +34 -0
- data/lib/qless/server/views/workers.erb +14 -0
- data/lib/qless/version.rb +1 -1
- data/lib/qless/worker.rb +11 -2
- metadata +72 -6
- data/lib/qless/qless-core/ruby/lib/qless-core.rb +0 -1
- data/lib/qless/qless-core/ruby/lib/qless/core.rb +0 -13
- data/lib/qless/qless-core/ruby/lib/qless/core/version.rb +0 -5
- data/lib/qless/qless-core/ruby/spec/qless_core_spec.rb +0 -13
@@ -0,0 +1,90 @@
|
|
1
|
+
<% if queues.empty? %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1>No Queues <small>I wish I had some queues :-/</small></h1>
|
4
|
+
</div>
|
5
|
+
<% else %>
|
6
|
+
<div class="page-header">
|
7
|
+
<h1>Queues <small>And their job counts</small></h1>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<% queues.each do |queue| %>
|
11
|
+
<div class="row">
|
12
|
+
<div class="span4">
|
13
|
+
<h3><a href="<%= u "/queues/#{queue['name']}" %>"><%= queue['name'] %></a></h3>
|
14
|
+
</div>
|
15
|
+
<div class="span8">
|
16
|
+
<h3> |
|
17
|
+
<%= queue['running'] %> /
|
18
|
+
<%= queue['waiting'] %> /
|
19
|
+
<%= queue['scheduled'] %> /
|
20
|
+
<%= queue['stalled'] %> /
|
21
|
+
<%= queue['depends'] %> /
|
22
|
+
<%= queue['recurring'] %> <small>(running / waiting / scheduled / stalled / depends / recurring)</small>
|
23
|
+
</h3>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<% if failed.empty? %>
|
30
|
+
<div class="page-header">
|
31
|
+
<h1>No Failed Jobs <small>Clean as a whistle</small></h1>
|
32
|
+
</div>
|
33
|
+
<% else %>
|
34
|
+
<div class="page-header">
|
35
|
+
<h1>Failed Jobs <small>D'oh!</small></h1>
|
36
|
+
</div>
|
37
|
+
<% failed.sort_by { |t, count| -count }.each do |t, count| %>
|
38
|
+
<div class="row">
|
39
|
+
<div class="span4">
|
40
|
+
<h3 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"><a href="<%= u "/failed/#{t}" %>"><%= t %></a></h3>
|
41
|
+
</div>
|
42
|
+
<div class="span8">
|
43
|
+
<h3>| <%= count %> <small>Jobs</small></h3>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
<% if tracked['jobs'].empty? %>
|
50
|
+
<div class="page-header">
|
51
|
+
<h1>No Tracked Jobs <small>These aren't the droids you're looking for</small></h1>
|
52
|
+
</div>
|
53
|
+
<% else %>
|
54
|
+
<div class="page-header">
|
55
|
+
<h1>Tracked Jobs <small>These <i>are</i> the droids you're looking for</small></h1>
|
56
|
+
</div>
|
57
|
+
<% counts = Hash.new; tracked['jobs'].each { |job| counts[job.state] ||= 0; counts[job.state] += 1 } %>
|
58
|
+
<% counts.sort_by { |state, count| - count }.each do |state, count| %>
|
59
|
+
<div class="row">
|
60
|
+
<div class="span4">
|
61
|
+
<h3><a href="<%= u "/track##{state}" %>"><%= state %></a></h3>
|
62
|
+
</div>
|
63
|
+
<div class="span8">
|
64
|
+
<h3>| <%= count %> <small>Jobs</small></h3>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
68
|
+
<% end %>
|
69
|
+
|
70
|
+
|
71
|
+
<% if workers.empty? %>
|
72
|
+
<div class="page-header">
|
73
|
+
<h1>No Workers <small>Nobody's doin' nothin'!</small></h1>
|
74
|
+
</div>
|
75
|
+
<% else %>
|
76
|
+
<div class="page-header">
|
77
|
+
<h1>Current Workers <small>And their job counts</small></h1>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<% workers.each do |worker| %>
|
81
|
+
<div class="row">
|
82
|
+
<div class="span4">
|
83
|
+
<h3><a href="<%= u "/workers/#{worker['name']}" %>"><%= worker['name'] %></a></h3>
|
84
|
+
</div>
|
85
|
+
<div class="span8">
|
86
|
+
<h3>| <%= worker['jobs'] %> / <%= worker['stalled'] %> <small>Running / Stalled</small></h3>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
<% end %>
|
90
|
+
<% end %>
|
@@ -0,0 +1,122 @@
|
|
1
|
+
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
2
|
+
<script type="text/javascript">
|
3
|
+
google.load("visualization", "1", {packages:["corechart"]});
|
4
|
+
google.setOnLoadCallback(drawCharts);
|
5
|
+
|
6
|
+
function drawCharts() {
|
7
|
+
drawChart(<%= JSON.generate(stats['wait']['histogram']) %>, 'wait-chart', 'Jobs / Minute');
|
8
|
+
drawChart(<%= JSON.generate(stats['run' ]['histogram']) %>, 'run-chart' , 'Jobs / Minute');
|
9
|
+
}
|
10
|
+
|
11
|
+
function drawChart(d, id, title) {
|
12
|
+
var data = new google.visualization.DataTable();
|
13
|
+
data.addColumn('string', 'Time');
|
14
|
+
data.addColumn('number', title);
|
15
|
+
|
16
|
+
var _data = [];
|
17
|
+
for (var i = 0; i < 60; ++i) {
|
18
|
+
_data.push([i + ' seconds', d[i] * 60]);
|
19
|
+
}
|
20
|
+
for (var i = 1; i < 60; ++i) {
|
21
|
+
_data.push([i + ' minutes', d[59 + i]]);
|
22
|
+
}
|
23
|
+
for (var i = 1; i < 24; ++i) {
|
24
|
+
_data.push([i + ' hours', d[118 + i] / 60]);
|
25
|
+
}
|
26
|
+
for (var i = 1; i < 7; ++i) {
|
27
|
+
_data.push([i + ' days', d[141 + i] / 1440]);
|
28
|
+
}
|
29
|
+
data.addRows(_data);
|
30
|
+
|
31
|
+
var options = {
|
32
|
+
legend: {position: 'none'},
|
33
|
+
chartArea: { width:"80%", height:"80%" }
|
34
|
+
};
|
35
|
+
|
36
|
+
var chart = new google.visualization.SteppedAreaChart(document.getElementById(id));
|
37
|
+
chart.draw(data, options);
|
38
|
+
}
|
39
|
+
</script>
|
40
|
+
|
41
|
+
<div class="subnav subnav-fixed">
|
42
|
+
<ul class="nav nav-pills">
|
43
|
+
<li class="<%= tab == 'stats' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/stats" %>">Stats</a></li>
|
44
|
+
<li class="<%= tab == 'running' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/running" %>">Running</a></li>
|
45
|
+
<li class="<%= tab == 'waiting' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/waiting" %>">Waiting</a></li>
|
46
|
+
<li class="<%= tab == 'scheduled' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/scheduled" %>">Scheduled</a></li>
|
47
|
+
<li class="<%= tab == 'stalled' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/stalled" %>">Stalled</a></li>
|
48
|
+
<li class="<%= tab == 'depends' ? 'active' : '' %>"><a href="<%= u "/queues/#{queue['name']}/depends" %>">Depends</a></li>
|
49
|
+
</ul>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
<div id="alerts" style="margin-top: 40px"></div>
|
53
|
+
|
54
|
+
<div class="row">
|
55
|
+
<div class="span8">
|
56
|
+
<h2><a href="<%= u "/queues/#{queue['name']}" %>"><%= queue['name'] %></a> |
|
57
|
+
<%= queue['running'] %> /
|
58
|
+
<%= queue['waiting'] %> /
|
59
|
+
<%= queue['scheduled'] %> /
|
60
|
+
<%= queue['stalled'] %> /
|
61
|
+
<%= queue['depends'] %> <small>(running / waiting / scheduled / stalled / depends)</small>
|
62
|
+
</h2>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="span4">
|
66
|
+
<div style="float:right">
|
67
|
+
<h2>
|
68
|
+
<%= stats['failed'] %> /
|
69
|
+
<%= stats['failures'] %> /
|
70
|
+
<%= stats['retries'] %> <small>(failed / failures / retries)</small>
|
71
|
+
</h2>
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<% if ['running', 'waiting', 'scheduled', 'stalled', 'depends'].include?(tab) %>
|
77
|
+
<hr/>
|
78
|
+
<%= erb :_job_list, :locals => { :jobs => jobs, :queues => queues } %>
|
79
|
+
<% else %>
|
80
|
+
<div class="row" style="margin-top: 15px">
|
81
|
+
<div class="span6">
|
82
|
+
<div class="well">
|
83
|
+
<div class="row">
|
84
|
+
<div class="span12">
|
85
|
+
<h3>Waiting</h3>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
<div class="row">
|
89
|
+
<div class="span12">
|
90
|
+
<h3>
|
91
|
+
<%= stats['wait']['count'] %> /
|
92
|
+
<%= sprintf('%10.3f', stats['wait']['mean']) %> /
|
93
|
+
<%= sprintf('%10.3f', stats['wait']['std']) %> <small>Total / Mean / Std. Deviation</small>
|
94
|
+
</h3>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div id="wait-chart" class="queue-stats-time-histogram-wait" style="height: 500px"></div>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div class="span6">
|
102
|
+
<div class="well">
|
103
|
+
<div class="row">
|
104
|
+
<div class="span12">
|
105
|
+
<h3>Running</h3>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<div class="row">
|
109
|
+
<div class="span12">
|
110
|
+
<h3>
|
111
|
+
<%= stats['run']['count'] %> /
|
112
|
+
<%= sprintf('%10.3f', stats['run']['mean']) %> /
|
113
|
+
<%= sprintf('%10.3f', stats['run']['std']) %> <small>Total / Mean / Std. Deviation</small>
|
114
|
+
</h3>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div id="run-chart" class="queue-stats-time-histogram-run" style="height: 500px"></div>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% if queues.empty? %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1>No Queues <small>I wish I had some queues :-/</small></h1>
|
4
|
+
</div>
|
5
|
+
<% else %>
|
6
|
+
<div class="page-header">
|
7
|
+
<h1>Queues <small>And their job counts</small></h1>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<% queues.each do |queue| %>
|
11
|
+
<div class="row">
|
12
|
+
<div class="span4">
|
13
|
+
<h3><a href="<%= u "/queues/#{queue['name']}" %>"><%= queue['name'] %></a></h3>
|
14
|
+
</div>
|
15
|
+
<div class="span8">
|
16
|
+
<h3> |
|
17
|
+
<%= queue['running'] %> /
|
18
|
+
<%= queue['waiting'] %> /
|
19
|
+
<%= queue['scheduled'] %> /
|
20
|
+
<%= queue['stalled'] %> /
|
21
|
+
<%= queue['depends'] %> <small>(running / waiting / scheduled / stalled / depends)</small>
|
22
|
+
</h3>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<script>
|
2
|
+
var fade = function(jid, type) {
|
3
|
+
if (type == 'cancel' || type == 'untrack') {
|
4
|
+
$('#job-' + jid).slideUp();
|
5
|
+
}
|
6
|
+
}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<div class="subnav subnav-fixed">
|
10
|
+
<ul class="nav nav-pills">
|
11
|
+
<li class="active"><a href="#all" data-toggle="tab">All (<%= tracked['jobs'].length %>)</a></li>
|
12
|
+
<li><a href="#running" data-toggle="tab">Running (<%= tracked['jobs'].select { |job| job.state == 'running' }.length %>)</a></li>
|
13
|
+
<li><a href="#waiting" data-toggle="tab">Waiting (<%= tracked['jobs'].select { |job| job.state == 'waiting' }.length %>)</a></li>
|
14
|
+
<li><a href="#scheduled" data-toggle="tab">Scheduled (<%= tracked['jobs'].select { |job| job.state == 'scheduled' }.length %>)</a></li>
|
15
|
+
<li><a href="#stalled" data-toggle="tab">Stalled (<%= tracked['jobs'].select { |job| job.state == 'stalled' }.length %>)</a></li>
|
16
|
+
<li><a href="#completed" data-toggle="tab">Completed (<%= tracked['jobs'].select { |job| job.state == 'complete' }.length %>)</a></li>
|
17
|
+
<li><a href="#failed" data-toggle="tab">Failed (<%= tracked['jobs'].select { |job| job.state == 'failed' }.length %>)</a></li>
|
18
|
+
<li><a href="#depends" data-toggle="tab">Depends (<%= tracked['jobs'].select { |job| job.state == 'depends' }.length %>)</a></li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div id="alerts" style="margin-top: 40px"></div>
|
23
|
+
|
24
|
+
<div class="page-header">
|
25
|
+
<h1>Tracked Jobs <small>These are all the jobs you're tracking</h1>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="tab-content">
|
29
|
+
<div class="tab-pane active" id="all">
|
30
|
+
<% tracked['jobs'].each do |job| %>
|
31
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
<div class="tab-pane" id="running">
|
35
|
+
<% tracked['jobs'].select { |job| job.state == 'running' }.each do |job| %>
|
36
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
<div class="tab-pane" id="waiting">
|
40
|
+
<% tracked['jobs'].select { |job| job.state == 'waiting' }.each do |job| %>
|
41
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
<div class="tab-pane" id="scheduled">
|
45
|
+
<% tracked['jobs'].select { |job| job.state == 'scheduled' }.each do |job| %>
|
46
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
<div class="tab-pane" id="stalled">
|
50
|
+
<% tracked['jobs'].select { |job| job.state == 'stalled' }.each do |job| %>
|
51
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
52
|
+
<% end %>
|
53
|
+
</div>
|
54
|
+
<div class="tab-pane" id="completed">
|
55
|
+
<% tracked['jobs'].select { |job| job.state == 'complete' }.each do |job| %>
|
56
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
57
|
+
<% end %>
|
58
|
+
</div>
|
59
|
+
<div class="tab-pane" id="failed">
|
60
|
+
<% tracked['jobs'].select { |job| job.state == 'failed' }.each do |job| %>
|
61
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
62
|
+
<% end %>
|
63
|
+
</div>
|
64
|
+
<div class="tab-pane" id="depends">
|
65
|
+
<% tracked['jobs'].select { |job| job.state == 'depends' }.each do |job| %>
|
66
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
67
|
+
<% end %>
|
68
|
+
</div>
|
69
|
+
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class="subnav subnav-fixed">
|
2
|
+
<ul class="nav nav-pills">
|
3
|
+
<li><a href="#Running">Running</a></li>
|
4
|
+
<li><a href="#Stalled">Stalled</a></li>
|
5
|
+
</ul>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="alerts" style="margin-top: 40px"></div>
|
9
|
+
|
10
|
+
<% if worker['jobs'].length > 0 %>
|
11
|
+
<div class="page-header">
|
12
|
+
<h1><%= worker['name'] %> <small>Running Jobs</small></h1>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<% worker['jobs'].each do |job| %>
|
16
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% if worker['stalled'].length > 0 %>
|
21
|
+
<div class="page-header">
|
22
|
+
<h1><%= worker['name'] %> <small>Stalled Jobs</small></h1>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<% worker['stalled'].each do |job| %>
|
26
|
+
<%= erb :_job, :layout => false, :locals => { :job => job, :queues => queues } %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% if worker['stalled'].length + worker['jobs'].length == 0 %>
|
31
|
+
<div class="page-header">
|
32
|
+
<h1><%= worker['name'] %> <small>Isn't Doing Anything</small></h1>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<h1>Current Workers <small>And their job counts</small></h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<% workers.each do |worker| %>
|
6
|
+
<div class="row">
|
7
|
+
<div class="span4">
|
8
|
+
<h3><a href="<%= u "/workers/#{worker['name']}" %>"><%= worker['name'] %></a></h3>
|
9
|
+
</div>
|
10
|
+
<div class="span8">
|
11
|
+
<h3>| <%= worker['jobs'] %> / <%= worker['stalled'] %> <small>Running / Stalled</small></h3>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
data/lib/qless/version.rb
CHANGED
data/lib/qless/worker.rb
CHANGED
@@ -10,9 +10,14 @@ module Qless
|
|
10
10
|
def initialize(client, job_reserver, options = {})
|
11
11
|
@client, @job_reserver = client, job_reserver
|
12
12
|
@shutdown = @paused = false
|
13
|
+
|
13
14
|
self.very_verbose = options[:very_verbose]
|
14
15
|
self.verbose = options[:verbose]
|
15
16
|
self.run_as_single_process = options[:run_as_single_process]
|
17
|
+
self.output = options.fetch(:output, $stdout)
|
18
|
+
|
19
|
+
output.puts "\n\n\n" if verbose || very_verbose
|
20
|
+
log "Instantiated Worker"
|
16
21
|
end
|
17
22
|
|
18
23
|
# Whether the worker should log basic info to STDOUT
|
@@ -26,6 +31,10 @@ module Qless
|
|
26
31
|
# This should only be true in a dev/test environment
|
27
32
|
attr_accessor :run_as_single_process
|
28
33
|
|
34
|
+
# An IO-like object that logging output is sent to.
|
35
|
+
# Defaults to $stdout.
|
36
|
+
attr_accessor :output
|
37
|
+
|
29
38
|
# Starts a worker based on ENV vars. Supported ENV vars:
|
30
39
|
# - REDIS_URL=redis://host:port/db-num (the redis gem uses this automatically)
|
31
40
|
# - QUEUES=high,medium,low or QUEUE=blah
|
@@ -179,10 +188,10 @@ module Qless
|
|
179
188
|
# Log a message to STDOUT if we are verbose or very_verbose.
|
180
189
|
def log(message)
|
181
190
|
if verbose
|
182
|
-
puts "*** #{message}"
|
191
|
+
output.puts "*** #{message}"
|
183
192
|
elsif very_verbose
|
184
193
|
time = Time.now.strftime('%H:%M:%S %Y-%m-%d')
|
185
|
-
puts "** [#{time}] #$$: #{message}"
|
194
|
+
output.puts "** [#{time}] #$$: #{message}"
|
186
195
|
end
|
187
196
|
end
|
188
197
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
@@ -123,6 +123,22 @@ dependencies:
|
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 1.1.2
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: poltergeist
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '1.0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '1.0'
|
126
142
|
- !ruby/object:Gem::Dependency
|
127
143
|
name: launchy
|
128
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,10 +195,6 @@ files:
|
|
179
195
|
- lib/qless/job_reservers/ordered.rb
|
180
196
|
- lib/qless/job_reservers/round_robin.rb
|
181
197
|
- lib/qless/lua.rb
|
182
|
-
- lib/qless/qless-core/ruby/lib/qless/core/version.rb
|
183
|
-
- lib/qless/qless-core/ruby/lib/qless/core.rb
|
184
|
-
- lib/qless/qless-core/ruby/lib/qless-core.rb
|
185
|
-
- lib/qless/qless-core/ruby/spec/qless_core_spec.rb
|
186
198
|
- lib/qless/queue.rb
|
187
199
|
- lib/qless/server.rb
|
188
200
|
- lib/qless/tasks.rb
|
@@ -209,9 +221,57 @@ files:
|
|
209
221
|
- lib/qless/qless-core/tag.lua
|
210
222
|
- lib/qless/qless-core/track.lua
|
211
223
|
- lib/qless/qless-core/workers.lua
|
224
|
+
- bin/install_phantomjs
|
212
225
|
- bin/qless-campfire
|
213
226
|
- bin/qless-growl
|
214
227
|
- bin/qless-web
|
228
|
+
- lib/qless/server/static/css/bootstrap-responsive.css
|
229
|
+
- lib/qless/server/static/css/bootstrap-responsive.min.css
|
230
|
+
- lib/qless/server/static/css/bootstrap.css
|
231
|
+
- lib/qless/server/static/css/bootstrap.min.css
|
232
|
+
- lib/qless/server/static/css/codemirror.css
|
233
|
+
- lib/qless/server/static/css/docs.css
|
234
|
+
- lib/qless/server/static/css/jquery.noty.css
|
235
|
+
- lib/qless/server/static/css/noty_theme_twitter.css
|
236
|
+
- lib/qless/server/static/css/style.css
|
237
|
+
- lib/qless/server/static/favicon.ico
|
238
|
+
- lib/qless/server/static/img/glyphicons-halflings-white.png
|
239
|
+
- lib/qless/server/static/img/glyphicons-halflings.png
|
240
|
+
- lib/qless/server/static/js/bootstrap-alert.js
|
241
|
+
- lib/qless/server/static/js/bootstrap-scrollspy.js
|
242
|
+
- lib/qless/server/static/js/bootstrap-tab.js
|
243
|
+
- lib/qless/server/static/js/bootstrap-tooltip.js
|
244
|
+
- lib/qless/server/static/js/bootstrap-typeahead.js
|
245
|
+
- lib/qless/server/static/js/bootstrap.js
|
246
|
+
- lib/qless/server/static/js/bootstrap.min.js
|
247
|
+
- lib/qless/server/static/js/codemirror.js
|
248
|
+
- lib/qless/server/static/js/jquery.noty.js
|
249
|
+
- lib/qless/server/static/js/mode/javascript.js
|
250
|
+
- lib/qless/server/static/js/theme/cobalt.css
|
251
|
+
- lib/qless/server/static/js/theme/eclipse.css
|
252
|
+
- lib/qless/server/static/js/theme/elegant.css
|
253
|
+
- lib/qless/server/static/js/theme/lesser-dark.css
|
254
|
+
- lib/qless/server/static/js/theme/monokai.css
|
255
|
+
- lib/qless/server/static/js/theme/neat.css
|
256
|
+
- lib/qless/server/static/js/theme/night.css
|
257
|
+
- lib/qless/server/static/js/theme/rubyblue.css
|
258
|
+
- lib/qless/server/static/js/theme/xq-dark.css
|
259
|
+
- lib/qless/server/views/_job.erb
|
260
|
+
- lib/qless/server/views/_job_list.erb
|
261
|
+
- lib/qless/server/views/_pagination.erb
|
262
|
+
- lib/qless/server/views/about.erb
|
263
|
+
- lib/qless/server/views/config.erb
|
264
|
+
- lib/qless/server/views/failed.erb
|
265
|
+
- lib/qless/server/views/failed_type.erb
|
266
|
+
- lib/qless/server/views/job.erb
|
267
|
+
- lib/qless/server/views/layout.erb
|
268
|
+
- lib/qless/server/views/overview.erb
|
269
|
+
- lib/qless/server/views/queue.erb
|
270
|
+
- lib/qless/server/views/queues.erb
|
271
|
+
- lib/qless/server/views/tag.erb
|
272
|
+
- lib/qless/server/views/track.erb
|
273
|
+
- lib/qless/server/views/worker.erb
|
274
|
+
- lib/qless/server/views/workers.erb
|
215
275
|
homepage: http://github.com/seomoz/qless
|
216
276
|
licenses: []
|
217
277
|
post_install_message:
|
@@ -224,12 +284,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
224
284
|
- - ! '>='
|
225
285
|
- !ruby/object:Gem::Version
|
226
286
|
version: '0'
|
287
|
+
segments:
|
288
|
+
- 0
|
289
|
+
hash: -4094860363148682256
|
227
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
291
|
none: false
|
229
292
|
requirements:
|
230
293
|
- - ! '>='
|
231
294
|
- !ruby/object:Gem::Version
|
232
295
|
version: '0'
|
296
|
+
segments:
|
297
|
+
- 0
|
298
|
+
hash: -4094860363148682256
|
233
299
|
requirements: []
|
234
300
|
rubyforge_project: qless
|
235
301
|
rubygems_version: 1.8.24
|