lib/dbox/syncer.rb in dbox-0.6.7 vs lib/dbox/syncer.rb in dbox-0.6.8

- old
+ new

@@ -1,8 +1,8 @@ module Dbox class Syncer - MAX_PARALLEL_DBOX_OPS = 5 + MAX_PARALLEL_DBOX_OPS = 3 MIN_BYTES_TO_STREAM_DOWNLOAD = 1024 * 100 # 100kB include Loggable def self.create(remote_path, local_path) @@ -618,15 +618,13 @@ end def upload_file(file) local_path = relative_to_local_path(file[:path]) remote_path = relative_to_remote_path(file[:path]) - File.open(local_path) do |f| - db_entry = database.find_by_path(file[:path]) - last_revision = db_entry ? db_entry[:revision] : nil - res = api.put_file(remote_path, f, last_revision) - process_basic_remote_props(res) - end + db_entry = database.find_by_path(file[:path]) + last_revision = db_entry ? db_entry[:revision] : nil + res = api.put_file(remote_path, local_path, last_revision) + process_basic_remote_props(res) end def force_metadata_update_from_server(entry) res = gather_remote_info(entry) unless res == :not_modified