Fixed a small bug that would still import the languages if not needed

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2020-10-27 23:39:34 +01:00
parent aad2f391fb
commit 485abe29e3

View File

@ -36,10 +36,12 @@ public final class LanguageManager {
logger.debug("Stored hash was '{}'.", storedHash); logger.debug("Stored hash was '{}'.", storedHash);
String actualHash = getActualHash(); String actualHash = getActualHash();
logger.debug("Actual hash is '{}'.", actualHash); logger.debug("Actual hash is '{}'.", actualHash);
if (storedHash == null || !storedHash.equals(actualHash)) {
logger.info("Importing new language file."); logger.info("Importing new language file.");
if (storedHash == null || !storedHash.equals(actualHash)) importLanguageFile(connection); importLanguageFile(connection);
logger.debug("Saving new hash in database."); logger.debug("Saving new hash in database.");
saveProperty(HASH_KEY, actualHash); saveProperty(HASH_KEY, actualHash);
}
} catch (SQLException | IOException | NoSuchAlgorithmException e) { } catch (SQLException | IOException | NoSuchAlgorithmException e) {
logger.error("Cannot update the languages right now. Reason: {}", e.getMessage()); logger.error("Cannot update the languages right now. Reason: {}", e.getMessage());
if (storedHash == null || storedHash.isEmpty()) System.exit(7); if (storedHash == null || storedHash.isEmpty()) System.exit(7);