lib/slack/web/pagination/cursor.rb in slack-ruby-client-0.13.1 vs lib/slack/web/pagination/cursor.rb in slack-ruby-client-0.14.0
- old
+ new
@@ -26,18 +26,21 @@
query = { limit: client.default_page_size }.merge(params).merge(cursor: next_cursor)
begin
response = client.send(verb, query)
rescue Slack::Web::Api::Errors::TooManyRequestsError => e
raise e if retry_count >= max_retries
+
client.logger.debug("#{self.class}##{__method__}") { e.to_s }
retry_count += 1
sleep(e.retry_after.seconds)
next
end
yield response
break unless response.response_metadata
+
next_cursor = response.response_metadata.next_cursor
break if next_cursor.blank?
+
retry_count = 0
sleep(sleep_interval) if sleep_interval
end
end
end