filecluster 0.1.0 → 0.1.1
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.
- data/lib/daemon/task_thread.rb +1 -0
- data/lib/fc/db.rb +1 -1
- data/lib/fc/storage.rb +1 -2
- data/lib/fc/version.rb +1 -1
- metadata +4 -4
data/lib/daemon/task_thread.rb
CHANGED
@@ -30,6 +30,7 @@ class TaskThread < BaseThread
|
|
30
30
|
item = FC::Item.find(item_storage.item_id)
|
31
31
|
src_item_storage = FC::ItemStorage.where("item_id = ? AND status = 'ready'", item.id).sample
|
32
32
|
src_storage = $all_storages.detect{|s| s.name == src_item_storage.storage_name}
|
33
|
+
$log.debug("Copy from #{src_storage.name} to #{storage.name} #{storage.path}#{item.name}")
|
33
34
|
item.copy_item_storage(src_storage, storage, item_storage)
|
34
35
|
rescue Exception => e
|
35
36
|
error "Copy item_storage error: #{e.message}; #{e.backtrace.join(', ')}", :item_id => item_storage.item_id, :item_storage_id => item_storage.id
|
data/lib/fc/db.rb
CHANGED
@@ -7,7 +7,7 @@ module FC
|
|
7
7
|
def self.connect_by_config(options)
|
8
8
|
@options = options.clone
|
9
9
|
@options[:port] = options[:port].to_i if options[:port]
|
10
|
-
@prefix = options[:prefix].to_s
|
10
|
+
@prefix = options[:prefix].to_s if options[:prefix]
|
11
11
|
@connects = {}
|
12
12
|
@connects[Thread.current.object_id] = Mysql2::Client.new(@options)
|
13
13
|
end
|
data/lib/fc/storage.rb
CHANGED
@@ -53,8 +53,7 @@ module FC
|
|
53
53
|
def copy_to_local(file_name, local_path)
|
54
54
|
src_path = "#{self.path}#{file_name}"
|
55
55
|
|
56
|
-
|
57
|
-
r = `#{cmd} 2>&1`
|
56
|
+
r = `mkdir -p #{File.dirname(local_path)} 2>&1`
|
58
57
|
raise r if $?.exitstatus != 0
|
59
58
|
|
60
59
|
cmd = self.class.curr_host == host ? "cp -r #{src_path} #{local_path}" : "scp -rB #{self.host}:#{src_path} #{local_path}"
|
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.1.
|
4
|
+
version: 0.1.1
|
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: 2013-04-
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rb-readline
|
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
segments:
|
188
188
|
- 0
|
189
|
-
hash:
|
189
|
+
hash: 4000916111344436581
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
none: false
|
192
192
|
requirements:
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '0'
|
196
196
|
segments:
|
197
197
|
- 0
|
198
|
-
hash:
|
198
|
+
hash: 4000916111344436581
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
201
|
rubygems_version: 1.8.24
|