X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneInserter.java;h=1445613f52c7684a824b414705b518b71a130047;hp=d5fe9a27ec0c20dc058df42e856931418ffb268b;hb=8f2392b1ad71157ffdbc78f8074d5a35543c8c75;hpb=0a57f545d8aff8e61cf6e8d9b85f17d45d4f45bb diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java index d5fe9a2..1445613 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java @@ -212,7 +212,7 @@ public class SoneInserter extends AbstractService { continue; } - InsertInformation insertInformation = null; + boolean insertSoneNow = false; synchronized (sone) { String fingerprint = sone.getFingerprint(); if (!fingerprint.equals(lastFingerprint)) { @@ -229,11 +229,12 @@ public class SoneInserter extends AbstractService { } if (modified && lastModificationTime.isPresent() && ((currentTimeMillis() - lastModificationTime.get()) > (insertionDelay * 1000))) { lastInsertedFingerprint = fingerprint; - insertInformation = new InsertInformation(sone); + insertSoneNow = true; } } - if (insertInformation != null) { + if (insertSoneNow) { + InsertInformation insertInformation = new InsertInformation(sone); logger.log(Level.INFO, String.format("Inserting Sone “%s”…", sone.getName())); boolean success = false;