reddit_bot 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reddit_bot.rb +1 -1
- data/lib/reddit_bot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ba776c1973d3a3c27aa97288b135840fc1b446
|
4
|
+
data.tar.gz: 4ba77ae39d86a2b144d8d933e455cdc2163d929d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7468a475101d393c35da187804ca9d9afd67b0ece18e20d8d35b8b66e2e362df6d34cdfba4a286dde581c60a7b0b6ff4afcf9fbd83f80a7e74d8cb2e9fa4e62
|
7
|
+
data.tar.gz: 22fb67409e5747ebe330e90a8d719e0ac3f293cb797b72ab60d4f75c8ace8ca876f142719227a22ad2c9ca8eec8900f83bb92b30b9bc9e98343274628ef09860
|
data/lib/reddit_bot.rb
CHANGED
@@ -247,7 +247,7 @@ module RedditBot
|
|
247
247
|
end
|
248
248
|
fail remaining[0] if remaining[0].size < 4
|
249
249
|
next if remaining[0].size > 4
|
250
|
-
t = (response.to_hash["x-ratelimit-reset"][0].to_f + 1) / remaining[0].to_f + 1
|
250
|
+
t = (response.to_hash["x-ratelimit-reset"][0].to_f + 1) / [remaining[0].to_f - 10, 1].max + 1
|
251
251
|
puts "sleeping #{t} seconds because of x-ratelimit"
|
252
252
|
sleep t
|
253
253
|
end
|
data/lib/reddit_bot/version.rb
CHANGED