seven1m-onebody-updateagent 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/updateagent/updateagent.rb +5 -2
  2. metadata +1 -1
@@ -1,5 +1,6 @@
1
- MAX_HASHES_AT_A_TIME = 1000
2
- MAX_TO_BATCH_AT_A_TIME = 25
1
+ MAX_HASHES_AT_A_TIME = 100
2
+ MAX_TO_BATCH_AT_A_TIME = 10
3
+ SLEEP_PERIOD = 5 # seconds
3
4
 
4
5
  DEBUG = false
5
6
 
@@ -124,6 +125,7 @@ class UpdateAgent
124
125
  end
125
126
  index += records.length
126
127
  print "#{resource.name} #{index}/#{@create.length + @update.length}\r"; STDOUT.flush
128
+ sleep SLEEP_PERIOD
127
129
  end
128
130
  puts
129
131
  end
@@ -159,6 +161,7 @@ class UpdateAgent
159
161
  @update << row if force or row.values_hash(@attributes) != record['hash']
160
162
  end
161
163
  @create += some_ids.reject { |id| hashes.map { |h| h['legacy_id'].to_i }.include?(id.to_i) }.map { |id| data_by_id[id.to_i] }
164
+ sleep SLEEP_PERIOD
162
165
  end
163
166
  puts
164
167
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seven1m-onebody-updateagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Morgan