This commit is contained in:
parent
66d29c343e
commit
bdad804eed
@ -72,13 +72,17 @@ 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))) {
|
||||||
log.info("Updating account for '{}', last update: {}",
|
try {
|
||||||
steamId,
|
log.info("Updating account for '{}', last update: {}",
|
||||||
scoresaberAccount == null ? "now" : TimeUtils.format(System.currentTimeMillis() - scoresaberAccount.getLastUpdated().getTime())
|
steamId,
|
||||||
);
|
scoresaberAccount == null ? "now" : TimeUtils.format(System.currentTimeMillis() - scoresaberAccount.getLastUpdated().getTime())
|
||||||
ScoreSaberAccountToken accountToken = scoreSaberService.getAccount(user);
|
);
|
||||||
user.setScoresaberAccount(ScoreSaberAccount.getFromToken(accountToken)); // Update the ScoreSaber account
|
ScoreSaberAccountToken accountToken = scoreSaberService.getAccount(user);
|
||||||
user.setUsername(accountToken.getName()); // Update the username
|
user.setScoresaberAccount(ScoreSaberAccount.getFromToken(accountToken)); // Update the ScoreSaber account
|
||||||
|
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) {
|
||||||
|
Reference in New Issue
Block a user