forked from j62/ctbrec
Fix request throttling
Requests to Chaturbate were not throttled properly
This commit is contained in:
parent
3df1dbf911
commit
63a91b830d
|
@ -262,10 +262,11 @@ public class Model {
|
||||||
|
|
||||||
private void throttleRequests() throws InterruptedException {
|
private void throttleRequests() throws InterruptedException {
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
long diff = now-lastRequest;
|
long diff = now - lastRequest;
|
||||||
if(diff < 500) {
|
if(diff < 500) {
|
||||||
Thread.sleep(diff);
|
Thread.sleep(diff);
|
||||||
}
|
}
|
||||||
|
lastRequest = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MasterPlaylist getMasterPlaylist(String modelName) throws IOException, ParseException, PlaylistException, ExecutionException {
|
public MasterPlaylist getMasterPlaylist(String modelName) throws IOException, ParseException, PlaylistException, ExecutionException {
|
||||||
|
|
Loading…
Reference in New Issue