mutx 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/templates/config.ru.tt +4 -0
- data/lib/generators/templates/restart.rb.tt +23 -14
- data/lib/mutx/background_jobs/sidekiq.rb +2 -2
- data/lib/mutx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fd133e11dc3c4e66e1018cd638263232925908e
|
|
4
|
+
data.tar.gz: 93205479b3beeec7fb73f2034cc16f4dfa39d458
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20aa28ef149c48c25f8610d678b3558cc51b91cdadc5934b7ede7afe1f8c94b75bf84842eea8ee2faa7094d94a694cbb63fe00c4094b916ce5f681ef776f05b2
|
|
7
|
+
data.tar.gz: 474ec6dcd645a8fd2e0f9a18bf32d89734ad65fc8eda99b44e9345bd60e42d055394c6899706d30983ffccf3ede46647627b2535dc55ec2f0ad7149f304cbfa6
|
|
@@ -2,22 +2,31 @@ require 'mutx'
|
|
|
2
2
|
require 'byebug'
|
|
3
3
|
|
|
4
4
|
module Cron
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
class RunningTaskError < StandardError
|
|
7
|
+
end
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
class Server
|
|
10
|
+
def self.restart
|
|
11
|
+
begin
|
|
12
|
+
running_task = []
|
|
13
|
+
running_task = check
|
|
14
|
+
`mutx stop && mutx restart` if running_task.eql? []
|
|
15
|
+
raise RunningTaskError if !running_task.eql? []
|
|
16
|
+
rescue RunningTaskError
|
|
17
|
+
puts
|
|
18
|
+
puts "Tasks running right now, cant restart, trying in 10 seconds!"
|
|
19
|
+
puts
|
|
20
|
+
sleep 10
|
|
21
|
+
retry
|
|
22
|
+
end
|
|
23
|
+
Mutx::Database::MongoConnector.force_close
|
|
24
|
+
end
|
|
10
25
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
puts "Tasks running right now, cant restart"
|
|
16
|
-
puts
|
|
17
|
-
end
|
|
18
|
-
Mutx::Database::MongoConnector.force_close
|
|
19
|
-
end
|
|
20
|
-
end#class
|
|
26
|
+
def self.check
|
|
27
|
+
Mutx::Database::MongoConnector.running_now
|
|
28
|
+
end
|
|
29
|
+
end#class
|
|
21
30
|
end#module
|
|
22
31
|
|
|
23
32
|
Cron::Server.restart
|
|
@@ -6,9 +6,9 @@ module Mutx
|
|
|
6
6
|
|
|
7
7
|
workers_dir = workers_dir = __FILE__.split("/")[0..-2].join("/")+ "/workers"
|
|
8
8
|
|
|
9
|
-
Mutx::Support::Console.execute "sidekiq -r #{workers_dir}/executor.rb -d -L mutx/logs/sidekiq.log -P mutx/sidekiq_pid"
|
|
9
|
+
#Mutx::Support::Console.execute "sidekiq -r #{workers_dir}/executor.rb -d -L mutx/logs/sidekiq.log -P mutx/sidekiq_pid"
|
|
10
10
|
Mutx::Support::Console.execute "sidekiq -r #{workers_dir}/mutx_cron.rb -d -L mutx/logs/sidekiq.log -P mutx/sidekiq_cron_pid"
|
|
11
|
-
Mutx::Support::Console.execute "sidekiq -r #{workers_dir}/update_started.rb -d -L mutx/logs/sidekiq.log -P mutx/sidekiq_update_started_pid"
|
|
11
|
+
#Mutx::Support::Console.execute "sidekiq -r #{workers_dir}/update_started.rb -d -L mutx/logs/sidekiq.log -P mutx/sidekiq_update_started_pid"
|
|
12
12
|
|
|
13
13
|
print "\n* Sidekiq:"
|
|
14
14
|
raise "Could not start Sidekiq correctly. Read mutx/logs/sidekiq.log file for more information" if not started?
|
data/lib/mutx/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mutx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.36
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roman Rodriguez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-11-
|
|
11
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|