in lib/aws-xray-sdk/sampling/lead_poller.rb [42:61]
def refresh_cache
candidates = get_candidates(@cache.rules)
if candidates.empty?
logger.debug %(No X-Ray sampling rules to report statistics. Skipping.)
return
end
result = @connector.fetch_sampling_targets(candidates)
targets = {}
result[:documents].each { |doc| targets[doc.rule_name] = doc }
@cache.load_targets(targets)
return unless @cache.last_updated && result[:last_modified].to_i > @cache.last_updated
logger.info 'Performing out-of-band sampling rule polling to fetch updated rules.'
@rule_poller.run
@rule_poller_elapsed = 0
rescue StandardError => e
logger.warn %(failed to fetch X-Ray sampling targets due to
end