myreplicator 1.1.61 → 1.1.62

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.
@@ -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;}
@@ -3,7 +3,7 @@ module Myreplicator
3
3
  before_filter :authenticated?
4
4
 
5
5
  private
6
-
6
+
7
7
  def authenticated?
8
8
  Kernel.p Myreplicator.auth_required
9
9
  if Myreplicator.auth_required
@@ -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
@@ -6,6 +6,9 @@
6
6
  <%= javascript_include_tag "myreplicator/application" %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
+ <%
10
+ %>
11
+
9
12
  <body>
10
13
 
11
14
  <div id="header"><h1><a href="<%= root_path %>"><span>C</span>My Replicator</a></h1></div>
@@ -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>
@@ -1,3 +1,3 @@
1
1
  module Myreplicator
2
- VERSION = "1.1.61"
2
+ VERSION = "1.1.62"
3
3
  end
@@ -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