Ruby Script:
I am dealing with a rate limit on the order of 1 request per second. How can I slow my script down so I don't receive errors?
Update: It was suggested I use Kernel [sleep][1]
I attempted to implement as follows: (Where Items is a table in the database)
Item.limit(10000).each do |item|
sleep(1)
//Make API Call Here
end
I think it's working!
You alway can use
Kernel#sleep
.