seven1m-onebody-updateagent 0.2.2 → 0.2.3
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.
- data/lib/updateagent/updateagent.rb +5 -2
- metadata +1 -1
@@ -1,5 +1,6 @@
|
|
1
|
-
MAX_HASHES_AT_A_TIME =
|
2
|
-
MAX_TO_BATCH_AT_A_TIME =
|
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
|