Skip to content

Commit

Permalink
and again...
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Feb 1, 2013
1 parent 43e1dc9 commit 376816e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/copy_data_to_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,12 @@ def split_up_file filename
sleep!(:server, "calculating md5 for large file .../#{File.basename(filename)}", 0)
file_md5 = Digest::MD5.file(filename)
sleep!(:server, "splitting up large file .../#{File.basename(filename)}", 0)
pieces_total = file_size / @dropbox_size
pieces_total = (file_size / @dropbox_size.to_f).ceil
pieces = []
file_count = 0
File.open(filename, 'rb') do |from_file|
while size < file_size
piece_filename = "#{filename}___piece_#{file_count}_of_#{pieces_total}_total_size_#{file_size}_md5_#{file_md5}"
_dbg
File.open(piece_filename, 'wb') do |to_file|
local_chunk_size = 1024*1024*128 # 128 MB reads, to avoid running out of Heap if you read 2.5GB at a time...
amount_read = 0
Expand Down

0 comments on commit 376816e

Please sign in to comment.