tasks_scheduler 0.6.9 → 0.6.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tasks_scheduler/alert.js +13 -12
- data/app/assets/javascripts/tasks_scheduler/status.js +9 -10
- data/app/assets/javascripts/tasks_scheduler.js +0 -1
- data/lib/tasks_scheduler/app_gem.rb +2 -2
- data/lib/tasks_scheduler/engine.rb +0 -1
- data/lib/tasks_scheduler/info.rb +2 -2
- data/lib/tasks_scheduler/version.rb +1 -1
- metadata +47 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ee844bf9ea12613412a5d92fc59a39cb033e1b6439e3856f5c212d96d8b2bcb
|
4
|
+
data.tar.gz: 2010b7ce90429896b57c9c8fbf69576b5586ccf5d2880ffe2b17d74f786bc638
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a4fdfae6c8b34248fcd26abb2f5437f13456e8800490dffd28df112864497d108c4e9ed4570282e4c8d84ef7342d90cea60a973d7e86ab04cebf80ce7e7e6c0
|
7
|
+
data.tar.gz: e22a5397e4abe58544adf097c92b33d98b3aeb211705f190eaf04763f7d7289f72c0904a2cfdc4c5f80f31a98ba9fdccc3eb28054ba0046a1c0454b46ddbdaea
|
@@ -1,20 +1,21 @@
|
|
1
|
+
//= require eac_rails_utils/url_helper
|
2
|
+
|
1
3
|
if (typeof TasksScheduler == "undefined") {
|
2
4
|
TasksScheduler = function() {};
|
3
5
|
}
|
4
6
|
|
5
|
-
TasksScheduler.Alert = function
|
6
|
-
};
|
7
|
+
TasksScheduler.Alert = function() {};
|
7
8
|
|
8
9
|
_A = TasksScheduler.Alert;
|
9
10
|
|
10
11
|
_A.DEFAULT_REFRESH_INTERVAL = 5000;
|
11
12
|
_A.DEFAULT_ELEMENT_SELECTOR = '#tasks_scheduler_alert';
|
12
13
|
_A.CSS_CLASSES_PREFIX = 'alert_';
|
13
|
-
_A.url =
|
14
|
+
_A.url = EacRailsUtils.UrlHelper.path_for('/tasks_scheduler_daemon/status');
|
14
15
|
|
15
|
-
_A.init = function
|
16
|
+
_A.init = function(options) {
|
16
17
|
options = typeof options !== 'undefined' ? options : {};
|
17
|
-
$(document).ready(function
|
18
|
+
$(document).ready(function() {
|
18
19
|
_A.options = options;
|
19
20
|
if (!_A.options.refresh_interval) {
|
20
21
|
_A.options.refresh_interval = _A.DEFAULT_REFRESH_INTERVAL;
|
@@ -26,26 +27,26 @@ _A.init = function (options) {
|
|
26
27
|
});
|
27
28
|
};
|
28
29
|
|
29
|
-
_A.setNextRefresh = function
|
30
|
+
_A.setNextRefresh = function() {
|
30
31
|
setTimeout(_A.refresh, _A.options.refresh_interval);
|
31
32
|
};
|
32
33
|
|
33
|
-
_A.refresh = function
|
34
|
+
_A.refresh = function() {
|
34
35
|
$.ajax(_A.refreshAjaxData());
|
35
36
|
};
|
36
37
|
|
37
|
-
_A.refreshAjaxData = function
|
38
|
+
_A.refreshAjaxData = function() {
|
38
39
|
return {
|
39
40
|
url: _A.url,
|
40
|
-
success: function
|
41
|
+
success: function(result) {
|
41
42
|
var alert = $(_A.options.element_selector);
|
42
43
|
var pattern = new RegExp('(^|\\s)' + _A.CSS_CLASSES_PREFIX + "\\S+", 'g');
|
43
|
-
alert.removeClass
|
44
|
-
return (className.match
|
44
|
+
alert.removeClass(function(index, className) {
|
45
|
+
return (className.match(pattern) || []).join(' ');
|
45
46
|
});
|
46
47
|
alert.addClass(_A.resultToCssClass(result));
|
47
48
|
},
|
48
|
-
complete: function
|
49
|
+
complete: function(result) {
|
49
50
|
_A.setNextRefresh();
|
50
51
|
}
|
51
52
|
};
|
@@ -2,15 +2,14 @@ if (typeof TasksScheduler == "undefined") {
|
|
2
2
|
TasksScheduler = function() {};
|
3
3
|
}
|
4
4
|
|
5
|
-
TasksScheduler.Status = function
|
6
|
-
};
|
5
|
+
TasksScheduler.Status = function() {};
|
7
6
|
|
8
7
|
// Shortcut
|
9
8
|
var _S = TasksScheduler.Status;
|
10
9
|
|
11
10
|
_S.initialized = false;
|
12
11
|
|
13
|
-
_S.init = function
|
12
|
+
_S.init = function(url, interval_max) {
|
14
13
|
if (!_S.initialized) {
|
15
14
|
_S.initialized = true;
|
16
15
|
_S.url = url;
|
@@ -19,21 +18,21 @@ _S.init = function (url, interval_max) {
|
|
19
18
|
}
|
20
19
|
};
|
21
20
|
|
22
|
-
_S.content = function
|
21
|
+
_S.content = function() {
|
23
22
|
return $('#TaskScheduler_Status_Content');
|
24
23
|
};
|
25
24
|
|
26
|
-
_S.status = function
|
25
|
+
_S.status = function() {
|
27
26
|
return $('#TaskScheduler_Status_Status');
|
28
27
|
};
|
29
28
|
|
30
|
-
_S.update_status = function
|
29
|
+
_S.update_status = function() {
|
31
30
|
_S.status().html(
|
32
31
|
"Updating in " + _S.interval + " seconds..."
|
33
32
|
);
|
34
33
|
};
|
35
34
|
|
36
|
-
_S.check = function
|
35
|
+
_S.check = function() {
|
37
36
|
if (_S.interval <= 0) {
|
38
37
|
_S.update();
|
39
38
|
} else {
|
@@ -43,17 +42,17 @@ _S.check = function () {
|
|
43
42
|
}
|
44
43
|
};
|
45
44
|
|
46
|
-
_S.update = function
|
45
|
+
_S.update = function() {
|
47
46
|
$.ajax(_S.updateAjaxData());
|
48
47
|
};
|
49
48
|
|
50
49
|
_S.updateAjaxData = function() {
|
51
50
|
return {
|
52
51
|
url: _S.url,
|
53
|
-
success: function
|
52
|
+
success: function(result) {
|
54
53
|
_S.content().html(result);
|
55
54
|
},
|
56
|
-
complete: function
|
55
|
+
complete: function(result) {
|
57
56
|
_S.interval = _S.interval_max + 1;
|
58
57
|
_S.last_update = new Date();
|
59
58
|
_S.check();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
4
|
require 'singleton'
|
5
5
|
|
6
6
|
module TasksScheduler
|
@@ -8,7 +8,7 @@ module TasksScheduler
|
|
8
8
|
include ::Singleton
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
super(::
|
11
|
+
super(::Avm::EacRubyBase1::Sources::Base.new(::Rails.root))
|
12
12
|
end
|
13
13
|
|
14
14
|
def bundle(*args)
|
data/lib/tasks_scheduler/info.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module TasksScheduler
|
4
4
|
class Info
|
5
5
|
TASKS_LIMIT_KEY = 'TASKS_SCHEDULER_TASKS_LIMIT'
|
6
|
-
TASKS_LIMIT_DEFAULT_VALUE =
|
6
|
+
TASKS_LIMIT_DEFAULT_VALUE = -1
|
7
7
|
|
8
8
|
class << self
|
9
9
|
def can_run_new_task?
|
@@ -17,7 +17,7 @@ module TasksScheduler
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def tasks_running_limit
|
20
|
-
ENV[TASKS_LIMIT_KEY].if_present(TASKS_LIMIT_DEFAULT_VALUE
|
20
|
+
ENV[TASKS_LIMIT_KEY].if_present(TASKS_LIMIT_DEFAULT_VALUE).to_i
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,111 +1,129 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tasks_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.12
|
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:
|
11
|
+
date: 2022-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: avm-eac_ruby_base1
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.8'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 0.8.1
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.8'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 0.8.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
34
|
+
name: daemons
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '1.4'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.4.1
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
47
|
- - "~>"
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
49
|
+
version: '1.4'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.4.1
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
54
|
+
name: eac_active_scaffold
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
57
|
- - "~>"
|
46
58
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
59
|
+
version: '0.2'
|
48
60
|
- - ">="
|
49
61
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
62
|
+
version: 0.2.3
|
51
63
|
type: :runtime
|
52
64
|
prerelease: false
|
53
65
|
version_requirements: !ruby/object:Gem::Requirement
|
54
66
|
requirements:
|
55
67
|
- - "~>"
|
56
68
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
69
|
+
version: '0.2'
|
58
70
|
- - ">="
|
59
71
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
72
|
+
version: 0.2.3
|
61
73
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
74
|
+
name: eac_rails_utils
|
63
75
|
requirement: !ruby/object:Gem::Requirement
|
64
76
|
requirements:
|
65
77
|
- - "~>"
|
66
78
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
79
|
+
version: '0.16'
|
68
80
|
type: :runtime
|
69
81
|
prerelease: false
|
70
82
|
version_requirements: !ruby/object:Gem::Requirement
|
71
83
|
requirements:
|
72
84
|
- - "~>"
|
73
85
|
- !ruby/object:Gem::Version
|
74
|
-
version: '0.
|
86
|
+
version: '0.16'
|
75
87
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
88
|
+
name: eac_ruby_utils
|
77
89
|
requirement: !ruby/object:Gem::Requirement
|
78
90
|
requirements:
|
79
91
|
- - "~>"
|
80
92
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
93
|
+
version: '0.95'
|
82
94
|
- - ">="
|
83
95
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
96
|
+
version: 0.95.1
|
85
97
|
type: :runtime
|
86
98
|
prerelease: false
|
87
99
|
version_requirements: !ruby/object:Gem::Requirement
|
88
100
|
requirements:
|
89
101
|
- - "~>"
|
90
102
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
103
|
+
version: '0.95'
|
92
104
|
- - ">="
|
93
105
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
106
|
+
version: 0.95.1
|
95
107
|
- !ruby/object:Gem::Dependency
|
96
108
|
name: parse-cron
|
97
109
|
requirement: !ruby/object:Gem::Requirement
|
98
110
|
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0.1'
|
99
114
|
- - ">="
|
100
115
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
116
|
+
version: 0.1.4
|
102
117
|
type: :runtime
|
103
118
|
prerelease: false
|
104
119
|
version_requirements: !ruby/object:Gem::Requirement
|
105
120
|
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0.1'
|
106
124
|
- - ">="
|
107
125
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
126
|
+
version: 0.1.4
|
109
127
|
- !ruby/object:Gem::Dependency
|
110
128
|
name: rails
|
111
129
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +145,9 @@ dependencies:
|
|
127
145
|
- - "~>"
|
128
146
|
- !ruby/object:Gem::Version
|
129
147
|
version: '0.4'
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 0.4.1
|
130
151
|
type: :development
|
131
152
|
prerelease: false
|
132
153
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -134,6 +155,9 @@ dependencies:
|
|
134
155
|
- - "~>"
|
135
156
|
- !ruby/object:Gem::Version
|
136
157
|
version: '0.4'
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 0.4.1
|
137
161
|
description:
|
138
162
|
email:
|
139
163
|
- eduardobogoni@gmail.com
|