Skip to content

Let configuration define the number of threads to upload concurrently #395

@oldigor

Description

@oldigor

I guess it is necessary to change only this piece of code

if self.config.concurrent_uploads
        threads = ThreadGroup.new
        # Upload new files
        local_files_to_upload.each do |f|
          next unless File.file? "#{path}/#{f}" # Only files.
          threads.add(Thread.new { upload_file f })
        end
        sleep 1 while threads.list.any? # wait for threads to finish uploading

in thttps://github.com/AssetSync/asset_sync/blob/11d206f316d67df9c8076bad9f5d5b5ba7f73d4c/lib/asset_sync/storage.rb#L245

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions