mutx 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutx/API/execution.rb +0 -4
- data/lib/mutx/background_jobs/workers/email_sender.rb +1 -3
- data/lib/mutx/commands/start.rb +0 -5
- data/lib/mutx/database/mongo_connector.rb +5 -18
- data/lib/mutx/results/result.rb +1 -1
- data/lib/mutx/support/clean.rb +0 -1
- data/lib/mutx/tasks/tasks.rb +2 -12
- data/lib/mutx/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be5dba99d94b6af03b1d5d8c2beb96e3ab997cf
|
4
|
+
data.tar.gz: 1edc577db14cb4e968ae1f678fc7cb824bb574fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0e248b5d40d2089a33337be0d8857a42fec91172f43534e499973ae7d302b14708a6fe261aa7a917b2d3a8e823d86a329f3b68aabea0ac9a57807139b70d15
|
7
|
+
data.tar.gz: c82b259b5f14667755e837419102ea1f6077e0c9265e2d52b91b1246ab28421b59b616600b7443213372c1370a00725774a70186ac6615cde11fbdd7d4a706df
|
data/lib/mutx/API/execution.rb
CHANGED
@@ -49,8 +49,6 @@ module Mutx
|
|
49
49
|
|
50
50
|
task.push_exec execution_id
|
51
51
|
|
52
|
-
task.set_running!
|
53
|
-
|
54
52
|
task.save!
|
55
53
|
|
56
54
|
Mutx::Support::Log.debug "Task #{task_name} setted as running" if Mutx::Support::Log
|
@@ -111,7 +109,6 @@ module Mutx
|
|
111
109
|
if result.pid
|
112
110
|
Mutx::Support::Processes.kill_p(result.pid)
|
113
111
|
killed = true
|
114
|
-
task.set_ready!
|
115
112
|
Mutx::Support::Log.debug "Execution (id=#{result.id}) killed"
|
116
113
|
end
|
117
114
|
rescue => e
|
@@ -131,7 +128,6 @@ module Mutx
|
|
131
128
|
result.show_as = "pending"
|
132
129
|
result.save!
|
133
130
|
|
134
|
-
# task.set_ready! if Mutx::Results.is_there_running_executions_for? task.name
|
135
131
|
if killed
|
136
132
|
message = "Execution: Stopped (forced) "
|
137
133
|
message += " Files: Cleanned" if cleanned
|
@@ -50,9 +50,7 @@ module Mutx
|
|
50
50
|
|
51
51
|
mail.add_file "result.html"
|
52
52
|
|
53
|
-
html_part.body "\nA continuacion se adjunta el resutado de la ejecucion solicitada"
|
54
|
-
html_part.body ""
|
55
|
-
html_part.body "\n-.Equipo [MuTX].-"
|
53
|
+
html_part.body "\nA continuacion se adjunta el resutado de la ejecucion solicitada. -.Equipo [MuTX].-"
|
56
54
|
|
57
55
|
puts "ENVIANDO RESULTADO VIA MAIL"
|
58
56
|
|
data/lib/mutx/commands/start.rb
CHANGED
@@ -65,11 +65,6 @@ module Mutx
|
|
65
65
|
Mutx::Support::FilesCleanner.clear_sidekiq_log
|
66
66
|
Mutx::Support::Log.debug "Sidekiq log file cleanned" if Mutx::Support::Log
|
67
67
|
|
68
|
-
# To prevent showing tasks as runnnig when service started recently reset all tasks
|
69
|
-
Mutx::Support::Log.debug "Reseting tasks statuses" if Mutx::Support::Log
|
70
|
-
Mutx::Tasks.reset!
|
71
|
-
Mutx::Support::Log.debug "Tasks statuses reseted" if Mutx::Support::Log
|
72
|
-
puts "\n* Tasks Status: Reseted"
|
73
68
|
|
74
69
|
# Force results to reset or finished status
|
75
70
|
Mutx::Support::Log.debug "Reseting defunct executions" if Mutx::Support::Log
|
@@ -142,18 +142,6 @@ module Mutx
|
|
142
142
|
["tasks","results","custom_params","commit","configuration"]
|
143
143
|
end
|
144
144
|
|
145
|
-
# Drops all mutx collections
|
146
|
-
# def self.drop_collections hard=false
|
147
|
-
# db = self.mutx_db
|
148
|
-
# collections_to_drop = collections
|
149
|
-
# unless hard
|
150
|
-
# ["custom_params","tasks"].each{|col| collections_to_drop.delete(col)}
|
151
|
-
# end
|
152
|
-
# collections_to_drop.each do |collection|
|
153
|
-
# db.drop_collection(collection) if collection != "documentation"
|
154
|
-
# end
|
155
|
-
# end
|
156
|
-
|
157
145
|
def self.drop_collections hard=false
|
158
146
|
collections_to_drop = self.collections
|
159
147
|
["custom_params","tasks"].each{|col| collections_to_drop.delete(col)} unless hard
|
@@ -162,10 +150,7 @@ module Mutx
|
|
162
150
|
end
|
163
151
|
end
|
164
152
|
|
165
|
-
|
166
|
-
# MongoClient.new().db(@@db_name)
|
167
|
-
# end
|
168
|
-
|
153
|
+
|
169
154
|
|
170
155
|
##################################
|
171
156
|
# COMMITS
|
@@ -271,12 +256,14 @@ module Mutx
|
|
271
256
|
|
272
257
|
def self.running type
|
273
258
|
Mutx::Support::Log.debug "Getting db running tasks" if Mutx::Support::Log
|
274
|
-
@@
|
259
|
+
@@results.find({"status" => /started|running/, "task.type" => type}).to_a.map do |result|
|
260
|
+
self.task_data_for result["task"]["id"]
|
261
|
+
end.uniq
|
275
262
|
end
|
276
263
|
|
277
264
|
def self.running_for_task task_name
|
278
265
|
Mutx::Support::Log.debug "Getting db running for task name #{task_name}" if Mutx::Support::Log
|
279
|
-
@@
|
266
|
+
@@results.find({"status" => /started|running/, "task.name" => task_name}).to_a
|
280
267
|
end
|
281
268
|
|
282
269
|
def self.active_tasks
|
data/lib/mutx/results/result.rb
CHANGED
data/lib/mutx/support/clean.rb
CHANGED
data/lib/mutx/tasks/tasks.rb
CHANGED
@@ -111,13 +111,11 @@ module Mutx
|
|
111
111
|
# Returns the ids for running tasks
|
112
112
|
# @return [Array] of task ids
|
113
113
|
def self.running_tasks
|
114
|
-
|
115
|
-
# Mutx::Database::MongoConnector.running_tasks
|
114
|
+
Mutx::Database::MongoConnector.running_tasks
|
116
115
|
end
|
117
116
|
|
118
117
|
def self.running_tests
|
119
|
-
|
120
|
-
# Mutx::Database::MongoConnector.running_tests
|
118
|
+
Mutx::Database::MongoConnector.running_tests
|
121
119
|
end
|
122
120
|
|
123
121
|
def self.exist_task? task_id
|
@@ -148,13 +146,5 @@ module Mutx
|
|
148
146
|
{success:success, message:message}
|
149
147
|
end
|
150
148
|
|
151
|
-
# Resets all Tasks
|
152
|
-
def self.reset!
|
153
|
-
Mutx::Support::Log.debug "Resetting tasks status" if Mutx::Support::Log
|
154
|
-
self.running_tasks.each do |task|
|
155
|
-
Mutx::Tasks::Task.get(task["_id"]).set_ready!
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
149
|
end
|
160
150
|
end
|
data/lib/mutx/version.rb
CHANGED