lib/eco/api/microcases/people_refresh.rb in eco-helpers-1.5.14 vs lib/eco/api/microcases/people_refresh.rb in eco-helpers-1.5.15
- old
+ new
@@ -16,10 +16,16 @@
created = people.length - ini
msg = "Going to refresh #{people.length} people with server data"
msg += " (including #{created} that were created)" if created > 0
logger.info(msg)
+
+ start = Time.now
entries = session.batch.get_people(people, silent: true)
+ secs = Time.now - start
+ cnt = entries.count
+ per_sec = (cnt.to_f / secs).floor
+ logger.info("Re-loaded #{cnt} people (out of #{people.length}) in #{secs} seconds (#{per_sec} people/sec)")
missing = people.length - entries.length
logger.error("Missed to obtain #{missing} people during the refresh") if missing > 0
Eco::API::Organization::People.new(entries)