myreplicator 1.1.61 → 1.1.62
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/myreplicator/application.css +2 -0
- data/app/controllers/myreplicator/application_controller.rb +1 -1
- data/app/controllers/myreplicator/home_controller.rb +4 -0
- data/app/helpers/myreplicator/application_helper.rb +13 -0
- data/app/views/layouts/myreplicator/application.html.erb +3 -0
- data/app/views/myreplicator/home/_home_menu.erb +2 -0
- data/lib/myreplicator/version.rb +1 -1
- data/test/dummy/lib/tasks/maintenance.rake +1 -4
- data/test/dummy/log/development.log +10638 -0
- data/test/dummy/tmp/cache/assets/C36/4A0/sprockets%2F545908d60919384cf74dd2658832a349 +0 -0
- data/test/dummy/tmp/cache/assets/CE8/8A0/sprockets%2F2ed5b94e22ac7a692e562c767944093a +0 -0
- data/test/dummy/tmp/cache/assets/D82/050/sprockets%2F3dfff61e335fbf562b9a98f8742d4b90 +0 -0
- metadata +3 -3
@@ -654,3 +654,5 @@ a.kill:hover:before {color:#990000}
|
|
654
654
|
}
|
655
655
|
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
656
656
|
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
657
|
+
|
658
|
+
#maint-message {background: rgb(169,3,41);background: -moz-linear-gradient(top, rgba(169,3,41,0.93) 0%, rgba(143,2,34,0.93) 44%, rgba(109,0,25,0.93) 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(169,3,41,0.93)), color-stop(44%,rgba(143,2,34,0.93)), color-stop(100%,rgba(109,0,25,0.93)));background: -webkit-linear-gradient(top, rgba(169,3,41,0.93) 0%,rgba(143,2,34,0.93) 44%,rgba(109,0,25,0.93) 100%);background: -o-linear-gradient(top, rgba(169,3,41,0.93) 0%,rgba(143,2,34,0.93) 44%,rgba(109,0,25,0.93) 100%);background: -ms-linear-gradient(top, rgba(169,3,41,0.93) 0%,rgba(143,2,34,0.93) 44%,rgba(109,0,25,0.93) 100%);background: linear-gradient(to bottom, rgba(169,3,41,0.93) 0%,rgba(143,2,34,0.93) 44%,rgba(109,0,25,0.93) 100%);-webkit-box-shadow:0 0 5px rgba(0,0,0,0.8);-moz-box-shadow:0 0 5px rgba(0,0,0,0.8);box-shadow:0 0 5px rgba(0,0,0,0.8);color:#fff;font-family: 'FrancoisOne';font-size:18px;font-weight:normal;left:0;line-height:42px;padding:3px 0 5px;position:fixed;text-align:center;text-shadow:1px 1px #222;top:0;width:100%;z-index:1000;}
|
@@ -51,6 +51,8 @@ module Myreplicator
|
|
51
51
|
resque_reload = Rake::Task['maintenance:stop_dr_jobs']
|
52
52
|
resque_reload.reenable
|
53
53
|
resque_reload.execute(ENV["RAILS_ENV"])
|
54
|
+
@redis = Redis.new(:host => Settings[:redis][:host], :port => Settings[:redis][:port])
|
55
|
+
@redis.set "under_maintenance", "true"
|
54
56
|
redirect_to :action => 'index'
|
55
57
|
end
|
56
58
|
|
@@ -61,6 +63,8 @@ module Myreplicator
|
|
61
63
|
resque_reload = Rake::Task['maintenance:start_dr_jobs']
|
62
64
|
resque_reload.reenable
|
63
65
|
resque_reload.execute(ENV["RAILS_ENV"])
|
66
|
+
@redis = Redis.new(:host => Settings[:redis][:host], :port => Settings[:redis][:port])
|
67
|
+
@redis.set "under_maintenance", "false"
|
64
68
|
redirect_to :action => 'index'
|
65
69
|
end
|
66
70
|
end
|
@@ -34,5 +34,18 @@ module Myreplicator
|
|
34
34
|
count = Log.where("state = 'error' AND job_type = 'transporter'").count
|
35
35
|
end
|
36
36
|
|
37
|
+
def under_maintenance
|
38
|
+
#@redis = Redis.new(:host => 'localhost', :port => 6379)
|
39
|
+
@redis = Redis.new(:host => Settings[:redis][:host], :port => Settings[:redis][:port])
|
40
|
+
tmp = @redis.get "under_maintenance"
|
41
|
+
puts tmp.class
|
42
|
+
if tmp == "true"
|
43
|
+
puts "===== ADASHKJDHJASKHDLASJLKDJALKS ====="
|
44
|
+
puts tmp
|
45
|
+
return true
|
46
|
+
end
|
47
|
+
return false
|
48
|
+
end
|
49
|
+
|
37
50
|
end
|
38
51
|
end
|
@@ -3,7 +3,9 @@
|
|
3
3
|
err2 = loader_err_count
|
4
4
|
err3 = transporter_err_count
|
5
5
|
run = run_count
|
6
|
+
um = under_maintenance
|
6
7
|
%>
|
8
|
+
<%if um == true%> <div id="maint-message">The site is currently under maintanence</div> <% end %>
|
7
9
|
<div class="home-menu">
|
8
10
|
<span>lists:</span>
|
9
11
|
<a href="<%= root_url %>" class="<% if @option == 'overview' %>on<% end %> overview">overview <% if run > 0 %><span><%= run %></span><% end %></a>
|
data/lib/myreplicator/version.rb
CHANGED
@@ -8,12 +8,9 @@ namespace :maintenance do
|
|
8
8
|
Resque.remove_schedule(export.schedule_name)
|
9
9
|
end
|
10
10
|
|
11
|
-
sql ="SELECT CLOSE_ALL_SESSIONS();"
|
12
|
-
Myreplicator::DB.exec_sql("vertica",sql)
|
13
|
-
|
14
11
|
Resque.remove_schedule("myreplicator_loader")
|
15
12
|
Resque.remove_schedule("myreplicator_sweeper")
|
16
|
-
Resque.remove_schedule("myreplicator_transporter")
|
13
|
+
Resque.remove_schedule("myreplicator_transporter")
|
17
14
|
end
|
18
15
|
|
19
16
|
task :start_dr_jobs do
|