puushload 0.1.1 → 1.0.0

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.
Files changed (2) hide show
  1. data/lib/puushload.rb +3 -7
  2. metadata +1 -1
data/lib/puushload.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require 'rubygems'
2
2
 
3
- gem "archive-tar-minitar", "~> 0.5.2"
4
-
5
3
  require 'puushload/puush_downloader'
6
4
  require 'puushload/puush_helper'
7
5
  require 'puushload/puush_id_generator'
@@ -12,7 +10,7 @@ require 'logger'
12
10
  require 'tmpdir'
13
11
 
14
12
  class PuushLoad
15
- MAX_THREADS = 50
13
+ MAX_THREADS = 20
16
14
  ARCHIVE_SIZE = 1000
17
15
 
18
16
  def initialize(outputFolder, logger)
@@ -33,12 +31,10 @@ class PuushLoad
33
31
  FileUtils.mkdir_p(@output_folder)
34
32
 
35
33
  PuushIDGenerator.generate do |id|
36
-
37
34
  spawned_threads << Thread.new {
38
- PuushDownloader.download_file(id, current_tmp_dir, @logger)
39
- downloaded_files += 1
35
+ downloaded_files += 1 if PuushDownloader.download_file(id, current_tmp_dir, @logger)
40
36
  }
41
-
37
+ sleep 0.01
42
38
  if spawned_threads.length >= MAX_THREADS
43
39
  spawned_threads.each { |spawnedThread| spawnedThread.join }
44
40
  spawned_threads.clear
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puushload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: