Module: Etl::Integrations::Core::RateLimiter
- Included in:
- Destination::Airtable::Client, Destination::FacebookCustomAudience::Client, Destination::GoogleSheets::Client, Destination::Hubspot::Client, Destination::Klaviyo::Client, Destination::SalesforceConsumerGoodsCloud::Client, Destination::SalesforceCrm::Client, Destination::Sftp::Client, Destination::Slack::Client, Destination::Stripe::Client, Destination::Tally::Client, Source::SalesforceConsumerGoodsCloud::Client, Source::ZohoBooks::Client
- Defined in:
- lib/etl/integrations/core/rate_limiter.rb
Instance Method Summary collapse
Instance Method Details
#write(sync_config, records, action = "insert") ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/etl/integrations/core/rate_limiter.rb', line 6 def write(sync_config, records, action = "insert") stream = sync_config.stream @queue ||= Limiter::RateQueue.new(stream.request_rate_limit, interval: stream.rate_limit_unit_seconds) do Integrations::Service.logger.info("Hit the limit for stream: #{stream.name}, waiting") end @queue.shift super(sync_config, records, action) end |