Retry with pause for rounds
This commit is contained in:
@@ -68,7 +68,20 @@ public class APIFootballUpdater {
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeRoundsToS3(league, content);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
if(e.getMessage().endsWith("did not have any results with status: 'Too many requests. Your rate limit is 10 requests per minute.")) {
|
||||
try {
|
||||
Thread.sleep(1000 * 60);
|
||||
String content = getRawData(apiFootballUrl);
|
||||
S3Provider prov = new S3Provider();
|
||||
prov.writeRoundsToS3(league, content);
|
||||
} catch (InterruptedException interruptedException) {
|
||||
interruptedException.printStackTrace();
|
||||
} catch (Exception exception) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
} else {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user