oh? x.x
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 35s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 35s
This commit is contained in:
parent
900ccba67e
commit
3f5eff3d1a
@ -188,10 +188,10 @@ public class ScoreSaberPlatform extends Platform {
|
|||||||
@Override
|
@Override
|
||||||
public void updateLeaderboards() {
|
public void updateLeaderboards() {
|
||||||
List<TrackedScore> scores = this.trackedScoreService.getTrackedScores(this.getPlatform(), false);
|
List<TrackedScore> scores = this.trackedScoreService.getTrackedScores(this.getPlatform(), false);
|
||||||
List<String> leaderboardIds = scores.stream().map(TrackedScore::getLeaderboardId).toList();
|
List<String> uniqueLeaderboardIds = scores.stream().map(TrackedScore::getLeaderboardId).distinct().toList();
|
||||||
|
|
||||||
log.info("Updating {} leaderboards for platform '{}'",
|
log.info("Updating {} leaderboards for platform '{}'",
|
||||||
leaderboardIds.size(),
|
uniqueLeaderboardIds.size(),
|
||||||
this.getPlatform().getPlatformName()
|
this.getPlatform().getPlatformName()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ public class ScoreSaberPlatform extends Platform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the leaderboards
|
// Update the leaderboards
|
||||||
for (String id : leaderboardIds) {
|
for (String id : uniqueLeaderboardIds) {
|
||||||
try {
|
try {
|
||||||
ScoreSaberLeaderboardToken leaderboard = this.scoreSaberService.getLeaderboard(id, true); // Update the cached leaderboard
|
ScoreSaberLeaderboardToken leaderboard = this.scoreSaberService.getLeaderboard(id, true); // Update the cached leaderboard
|
||||||
if (leaderboard == null) {
|
if (leaderboard == null) {
|
||||||
@ -251,14 +251,14 @@ public class ScoreSaberPlatform extends Platform {
|
|||||||
this.getPlatform().getPlatformName(),
|
this.getPlatform().getPlatformName(),
|
||||||
toUpdate.size(),
|
toUpdate.size(),
|
||||||
finished,
|
finished,
|
||||||
leaderboardIds.size()
|
uniqueLeaderboardIds.size()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Sleep to prevent rate limiting
|
// Sleep to prevent rate limiting
|
||||||
try {
|
try {
|
||||||
Thread.sleep(UPDATE_DELAY);
|
Thread.sleep(UPDATE_DELAY);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
log.error("Failed to sleep for rate limit reset", e);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("An error occurred while updating leaderboard '{}'", id, ex);
|
log.error("An error occurred while updating leaderboard '{}'", id, ex);
|
||||||
|
Reference in New Issue
Block a user