From 63a91b830df4ab5df3c7c16244f7995cb890f05c Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Mon, 1 Oct 2018 17:25:35 +0200 Subject: [PATCH] Fix request throttling Requests to Chaturbate were not throttled properly --- src/main/java/ctbrec/Model.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ctbrec/Model.java b/src/main/java/ctbrec/Model.java index 54bbf3a2..25d30adb 100644 --- a/src/main/java/ctbrec/Model.java +++ b/src/main/java/ctbrec/Model.java @@ -262,10 +262,11 @@ public class Model { private void throttleRequests() throws InterruptedException { long now = System.currentTimeMillis(); - long diff = now-lastRequest; + long diff = now - lastRequest; if(diff < 500) { Thread.sleep(diff); } + lastRequest = now; } public MasterPlaylist getMasterPlaylist(String modelName) throws IOException, ParseException, PlaylistException, ExecutionException {