Skip to content

Commit

Permalink
randomize the counter when using multiple output directories to move …
Browse files Browse the repository at this point in the history
…evenly spread the load
  • Loading branch information
Dhruv Bansal committed Sep 24, 2013
1 parent a43ecdc commit 9a2bca7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/wukong-load/syncers/prepare_syncer/handler.rb
Expand Up @@ -34,6 +34,7 @@ def initialize syncer, settings
self.syncer = syncer
self.settings = settings
self.counter = 0
self.counter = rand(settings[:output].size) if settings[:output] && settings[:output].size > 1
extend (settings[:dry_run] ? FileUtils::NoWrite : FileUtils)
extend OrderedHandler if settings[:ordered]
end
Expand Down

0 comments on commit 9a2bca7

Please sign in to comment.