lib/eco/api/microcases/people_refresh.rb in eco-helpers-2.7.24 vs lib/eco/api/microcases/people_refresh.rb in eco-helpers-2.7.25
- old
+ new
@@ -24,20 +24,28 @@
end
created = people.length - ini
msg = "Going to refresh #{people.length} people with server data"
msg += " (including #{created} that were created)" if created.positive?
- logger.info(msg)
+ log(:info) { msg }
start = Time.now
entries = session.batch.get_people(people, silent: true)
secs = (Time.now - start).round(3)
cnt = entries.count
per_sec = (cnt.to_f / secs).round(2)
- logger.info("Re-loaded #{cnt} people (out of #{people.length}) in #{secs} seconds (#{per_sec} people/sec)")
+ log(: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.positive?
+
+ if missing.positive?
+ log(:error) {
+ "Missed to obtain #{missing} people during the refresh"
+ }
+ end
Eco::API::Organization::People.new(entries)
end
end
end