tasks_scheduler 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 455e3bc8143c47e770a49410d5db8f896eab85fb
|
4
|
+
data.tar.gz: 3334d0012b0c26ac6f8c6a3a59a2f1f393d5e92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9943a9c7ff126b77d906ac2b9ef996c89c51d4494886612b3936c73afb543136e5c280a4a92d60ef5349fa54225c8754947d67ade966553c9d97d1b4d2072c2
|
7
|
+
data.tar.gz: 96198cd7b08d9e67b801ac05b3594c8d038246d7adbac2ff9c8ac208f6b2f63e19f33ed50c39a2a0c3c9bfeb0a3646af5a76bc4bec92a3e54009abd65883eb25
|
@@ -4,7 +4,7 @@ function TasksScheduler() {
|
|
4
4
|
}
|
5
5
|
|
6
6
|
TasksScheduler.Status = function () {
|
7
|
-
}
|
7
|
+
};
|
8
8
|
|
9
9
|
// Shortcut
|
10
10
|
var _S = TasksScheduler.Status;
|
@@ -67,7 +67,8 @@ _A.DEFAULT_REFRESH_INTERVAL = 60000;
|
|
67
67
|
_A.DEFAULT_ELEMENT_SELECTOR = '#tasks_scheduler_alert';
|
68
68
|
_A.url = null;
|
69
69
|
|
70
|
-
_A.init = function (url, options
|
70
|
+
_A.init = function (url, options) {
|
71
|
+
options = typeof options !== 'undefined' ? options : {};
|
71
72
|
$(document).ready(function () {
|
72
73
|
_A.url = url;
|
73
74
|
_A.options = options;
|
@@ -27,6 +27,7 @@ class ScheduledTask < ActiveRecord::Base
|
|
27
27
|
run_log("Task: #{self}")
|
28
28
|
run_log("PID: #{pid ? pid : '-'} (Current: #{Process.pid})")
|
29
29
|
run_log("Process running? #{process_running? ? 'Yes' : 'No'}")
|
30
|
+
run_log("Rails.env: #{Rails.env}")
|
30
31
|
end
|
31
32
|
|
32
33
|
def invoke_task
|
@@ -17,10 +17,12 @@ module TasksScheduler
|
|
17
17
|
def execute(action)
|
18
18
|
raise "Action not allowed: #{action} (Allowed: #{ACTIONS})" unless ACTIONS.include?(action)
|
19
19
|
command = ['bundle', 'exec', 'tasks_scheduler', action]
|
20
|
+
env_args = { 'RAILS_ENV' => Rails.env }
|
20
21
|
Dir.chdir(Rails.root) do
|
21
|
-
Open3.popen3(*command) do |_stdin, stdout, stderr, wait_thr|
|
22
|
-
{ action: action,
|
23
|
-
|
22
|
+
Open3.popen3(env_args, *command) do |_stdin, stdout, stderr, wait_thr|
|
23
|
+
{ action: action, env_args: env_args.map { |k, v| "#{k}=#{v}" }.join(' | '),
|
24
|
+
command: command.join(' '), status: wait_thr.value.to_i, stdout: stdout.read,
|
25
|
+
stderr: stderr.read }
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tasks_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
@@ -184,46 +184,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.6.12
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: Scheduler for Rake tasks.
|
191
191
|
test_files:
|
192
|
-
- test/fixtures/scheduled_tasks.yml
|
193
|
-
- test/models/scheduled_task_test.rb
|
194
|
-
- test/dummy/config.ru
|
195
|
-
- test/dummy/README.rdoc
|
196
|
-
- test/dummy/db/schema.rb
|
197
|
-
- test/dummy/app/views/layouts/application.html.erb
|
198
|
-
- test/dummy/app/assets/stylesheets/application.css
|
199
|
-
- test/dummy/app/assets/javascripts/application.js
|
200
|
-
- test/dummy/app/helpers/application_helper.rb
|
201
|
-
- test/dummy/app/controllers/application_controller.rb
|
202
|
-
- test/dummy/bin/bundle
|
203
|
-
- test/dummy/bin/rails
|
204
|
-
- test/dummy/bin/setup
|
205
|
-
- test/dummy/bin/rake
|
206
192
|
- test/dummy/Rakefile
|
207
|
-
- test/dummy/
|
208
|
-
- test/dummy/config
|
209
|
-
- test/dummy/config/environments/development.rb
|
210
|
-
- test/dummy/config/application.rb
|
193
|
+
- test/dummy/README.rdoc
|
194
|
+
- test/dummy/config.ru
|
211
195
|
- test/dummy/config/boot.rb
|
196
|
+
- test/dummy/config/database.yml
|
197
|
+
- test/dummy/config/secrets.yml
|
212
198
|
- test/dummy/config/locales/en.yml
|
199
|
+
- test/dummy/config/application.rb
|
200
|
+
- test/dummy/config/environments/development.rb
|
201
|
+
- test/dummy/config/environments/test.rb
|
202
|
+
- test/dummy/config/environments/production.rb
|
203
|
+
- test/dummy/config/environment.rb
|
204
|
+
- test/dummy/config/routes.rb
|
205
|
+
- test/dummy/config/initializers/assets.rb
|
206
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
207
|
+
- test/dummy/config/initializers/inflections.rb
|
213
208
|
- test/dummy/config/initializers/session_store.rb
|
214
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
215
209
|
- test/dummy/config/initializers/wrap_parameters.rb
|
210
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
216
211
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
217
|
-
- test/dummy/config/initializers/inflections.rb
|
218
|
-
- test/dummy/config/initializers/assets.rb
|
219
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
220
212
|
- test/dummy/config/initializers/mime_types.rb
|
221
|
-
- test/dummy/
|
222
|
-
- test/dummy/
|
223
|
-
- test/dummy/
|
224
|
-
- test/dummy/
|
213
|
+
- test/dummy/db/schema.rb
|
214
|
+
- test/dummy/app/views/layouts/application.html.erb
|
215
|
+
- test/dummy/app/controllers/application_controller.rb
|
216
|
+
- test/dummy/app/helpers/application_helper.rb
|
217
|
+
- test/dummy/app/assets/stylesheets/application.css
|
218
|
+
- test/dummy/app/assets/javascripts/application.js
|
225
219
|
- test/dummy/public/422.html
|
226
|
-
- test/dummy/public/favicon.ico
|
227
220
|
- test/dummy/public/404.html
|
221
|
+
- test/dummy/public/favicon.ico
|
228
222
|
- test/dummy/public/500.html
|
223
|
+
- test/dummy/bin/bundle
|
224
|
+
- test/dummy/bin/setup
|
225
|
+
- test/dummy/bin/rails
|
226
|
+
- test/dummy/bin/rake
|
229
227
|
- test/test_helper.rb
|
228
|
+
- test/fixtures/scheduled_tasks.yml
|
229
|
+
- test/models/scheduled_task_test.rb
|