cloudsync 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.4.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudsync}
8
- s.version = "2.3.0"
8
+ s.version = "2.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cory Forsyth"]
12
- s.date = %q{2010-10-20}
12
+ s.date = %q{2010-10-25}
13
13
  s.default_executable = %q{cloudsync}
14
14
  s.description = %q{Sync files between various clouds or sftp servers. Available backends are S3, CloudFiles, and SFTP servers. Can sync, mirror, and prune.}
15
15
  s.email = %q{cory.forsyth@gmail.com}
@@ -73,7 +73,7 @@ module Cloudsync
73
73
  raise NotImplementedError
74
74
  end
75
75
 
76
- def files_to_sync(upload_prefix={})
76
+ def files_to_sync(upload_prefix="")
77
77
  raise NotImplementedError
78
78
  end
79
79
 
@@ -73,13 +73,13 @@ module Cloudsync
73
73
  if delete_container_if_empty
74
74
  container.refresh
75
75
  if container.empty?
76
- $LOGGER.debug("Deleting empty container '#{container.name}'")
76
+ $LOGGER.info("Deleting empty container '#{container.name}'")
77
77
  @store.delete_container(container.name)
78
78
  end
79
79
  end
80
80
 
81
81
  rescue NoSuchContainerException, NoSuchObjectException => e
82
- $LOGGER.error("Failed to delete file #{file}")
82
+ $LOGGER.error("Failed to delete file #{file}, container #{container.name}")
83
83
  end
84
84
 
85
85
  def get_file_from_store(file)
@@ -113,10 +113,6 @@ module Cloudsync
113
113
  end
114
114
  end
115
115
 
116
- # cf = Cloudsync::Backend::CloudFiles.new( YAML::load_file("cloudsync.yml")[:cloudfiles]); $LOGGER = Logger.new(STDOUT); count = 0; cf.files_to_sync {|p,h| count += 1 }; puts count
117
- # cf = Cloudsync::Backend::CloudFiles.new( YAML::load_file("cloudsync.yml")[:cloudfiles]); $LOGGER = Logger.new(STDOUT); count = 0; paths = []; cf.files_to_sync("mpsounds-adobe.max.trivia") {|f| count += 1; paths << f.path}; puts count
118
-
119
-
120
116
  # prefix_path must not include the container name at the beginning of the string
121
117
  def objects_from_container(container, prefix_path="", &block)
122
118
  $LOGGER.debug("Getting files from #{container.name} (prefix: #{prefix_path})")
@@ -131,7 +127,6 @@ module Cloudsync
131
127
  objects_details = container.objects_detail(params)
132
128
 
133
129
  $LOGGER.debug("OFC #{container.name} (#{prefix_path}) got #{objects_details.size}. #{objects_details.class}")
134
- $LOGGER.debug("-"*50)
135
130
 
136
131
  break if objects_details.empty?
137
132
 
@@ -111,12 +111,10 @@ module Cloudsync
111
111
  params['prefix'] = prefix if !prefix.nil?
112
112
 
113
113
  loop do
114
- $LOGGER.debug(params.inspect)
115
114
  keys = bucket.keys(params)
116
115
  break if keys.empty?
117
116
 
118
117
  keys.each do |key|
119
- $LOGGER.debug(key.name)
120
118
  yield key
121
119
  end
122
120
 
@@ -92,6 +92,15 @@ module Cloudsync
92
92
  $LOGGER.info("[SM]: Prune: Completed #{index} files (skipped: #{file_stats[:skipped].size}, removed: #{file_stats[:removed].size}).")
93
93
  end
94
94
 
95
+ if index % Cloudsync::Backend::Base::OBJECT_LIMIT == 0
96
+ $LOGGER.debug("GC starting")
97
+ GC.start
98
+
99
+ memory_usage = `ps -o rss= -p #{$$}`.to_i
100
+ ocount = 0; ObjectSpace.each_object {|o| ocount += 1}
101
+ $LOGGER.debug "memory: #{memory_usage}, objects: #{ocount}"
102
+ end
103
+
95
104
  index += 1
96
105
  end
97
106
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudsync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 2.3.0
10
+ version: 2.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cory Forsyth
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-20 00:00:00 -04:00
18
+ date: 2010-10-25 00:00:00 -04:00
19
19
  default_executable: cloudsync
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency