api: oopsie doodle
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Failing after 33s

This commit is contained in:
Lee 2024-08-02 19:28:30 +01:00
parent 66d29c343e
commit bdad804eed

@ -72,6 +72,7 @@ public class UserService {
// Ensure the users ScoreSaber account is up-to-date // Ensure the users ScoreSaber account is up-to-date
ScoreSaberAccount scoresaberAccount = user.getScoresaberAccount(); ScoreSaberAccount scoresaberAccount = user.getScoresaberAccount();
if (scoresaberAccount == null || scoresaberAccount.getLastUpdated().before(new Date(System.currentTimeMillis() - FORCE_UPDATE_INTERVAL))) { if (scoresaberAccount == null || scoresaberAccount.getLastUpdated().before(new Date(System.currentTimeMillis() - FORCE_UPDATE_INTERVAL))) {
try {
log.info("Updating account for '{}', last update: {}", log.info("Updating account for '{}', last update: {}",
steamId, steamId,
scoresaberAccount == null ? "now" : TimeUtils.format(System.currentTimeMillis() - scoresaberAccount.getLastUpdated().getTime()) scoresaberAccount == null ? "now" : TimeUtils.format(System.currentTimeMillis() - scoresaberAccount.getLastUpdated().getTime())
@ -79,6 +80,9 @@ public class UserService {
ScoreSaberAccountToken accountToken = scoreSaberService.getAccount(user); ScoreSaberAccountToken accountToken = scoreSaberService.getAccount(user);
user.setScoresaberAccount(ScoreSaberAccount.getFromToken(accountToken)); // Update the ScoreSaber account user.setScoresaberAccount(ScoreSaberAccount.getFromToken(accountToken)); // Update the ScoreSaber account
user.setUsername(accountToken.getName()); // Update the username user.setUsername(accountToken.getName()); // Update the username
} catch (Exception ex) {
log.error("Failed to update ScoreSaber account for '{}'", steamId, ex);
}
shouldUpdate = true; shouldUpdate = true;
} }
if (shouldUpdate) { if (shouldUpdate) {