filecluster 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/fc-daemon +2 -1
- data/lib/daemon/copy_task_thread.rb +1 -1
- data/lib/daemon/global_daemon_thread.rb +0 -11
- data/lib/fc/storage.rb +2 -2
- data/lib/fc/version.rb +1 -1
- metadata +4 -4
data/bin/fc-daemon
CHANGED
@@ -58,7 +58,8 @@ start_time = Time.new.to_i
|
|
58
58
|
while true do
|
59
59
|
if $exit_signal
|
60
60
|
$log.debug('wait tasks_threads')
|
61
|
-
$
|
61
|
+
$tasks_copy_threads.each {|t| t.join}
|
62
|
+
$tasks_delete_threads.each {|t| t.join}
|
62
63
|
if $global_daemon_thread
|
63
64
|
$log.debug('wait global_daemon_thread')
|
64
65
|
$global_daemon_thread.join
|
@@ -4,7 +4,7 @@ class CopyTaskThread < BaseThread
|
|
4
4
|
Thread.current[:tasks_processed] = 0 unless Thread.current[:tasks_processed]
|
5
5
|
while task = $tasks_copy[storage_name].shift do
|
6
6
|
$curr_tasks << task
|
7
|
-
$log.debug("CopyTaskThread(#{storage_name}): run task for item_storage ##{task.id}")
|
7
|
+
$log.debug("CopyTaskThread(#{storage_name}): run task for item_storage ##{task.id}, copy_count=#{$copy_count}")
|
8
8
|
make_copy(task)
|
9
9
|
$curr_tasks.delete(task)
|
10
10
|
$log.debug("CopyTaskThread(#{storage_name}): finish task for item_storage ##{task.id}")
|
@@ -29,17 +29,6 @@ class GlobalDaemonThread < BaseThread
|
|
29
29
|
all_storages = FC::Storage.where
|
30
30
|
all_policies = FC::Policy.where
|
31
31
|
|
32
|
-
# policies.get_storages => all_policies.select
|
33
|
-
all_storages.each do |storage|
|
34
|
-
metaclass = class << storage; self; end
|
35
|
-
metaclass.send(:define_method, :get_copy_storages) do
|
36
|
-
self.class.get_copy_storages_mutex.synchronize do
|
37
|
-
@copy_storages_cache ||= self.copy_storages.to_s.split(',').map{|storage_name| all_storages.detect{|s| storage_name == s.name} }
|
38
|
-
end
|
39
|
-
@copy_storages_cache
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
32
|
limit = FC::Var.get('daemon_global_tasks_group_limit', 1000).to_i
|
44
33
|
all_policies.each do |policy|
|
45
34
|
next if policy.copies.to_i < 2
|
data/lib/fc/storage.rb
CHANGED
@@ -61,7 +61,7 @@ module FC
|
|
61
61
|
|
62
62
|
cmd = self.class.curr_host == host ?
|
63
63
|
"cp -r #{local_path.shellescape} #{dst_path.shellescape}" :
|
64
|
-
"scp -
|
64
|
+
"scp -r -oBatchMode=yes -oStrictHostKeyChecking=no #{local_path.shellescape} #{self.host}:\"#{dst_path.shellescape}\""
|
65
65
|
r = `#{cmd} 2>&1`
|
66
66
|
raise r if $?.exitstatus != 0
|
67
67
|
end
|
@@ -75,7 +75,7 @@ module FC
|
|
75
75
|
|
76
76
|
cmd = self.class.curr_host == host ?
|
77
77
|
"cp -r #{src_path.shellescape} #{local_path.shellescape}" :
|
78
|
-
"scp -
|
78
|
+
"scp -r -oBatchMode=yes -oStrictHostKeyChecking=no #{self.host}:\"#{src_path.shellescape}\" #{local_path.shellescape}"
|
79
79
|
r = `#{cmd} 2>&1`
|
80
80
|
raise r if $?.exitstatus != 0
|
81
81
|
end
|
data/lib/fc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filecluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rb-readline
|
@@ -193,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
segments:
|
195
195
|
- 0
|
196
|
-
hash:
|
196
|
+
hash: 1925480104148828802
|
197
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
198
|
none: false
|
199
199
|
requirements:
|
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
segments:
|
204
204
|
- 0
|
205
|
-
hash:
|
205
|
+
hash: 1925480104148828802
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
208
|
rubygems_version: 1.8.24
|