From: David ‘Bombe’ Roden Date: Sun, 19 Jul 2015 18:38:35 +0000 (+0200) Subject: Revert "Store Sone earlier when creating new Sone" X-Git-Tag: 0.9.2^2~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d90d5d1cf6accb7715843a5e49be737e45a929bb;p=Sone.git Revert "Store Sone earlier when creating new Sone" This reverts commit b64a9dcfdd584c6c6b7da45066b27bcc17cf6942. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 95b4bfe..73bb95f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -645,14 +645,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, sone.setLatestEdition(fromNullable(tryParse(property)).or(0L)); sone.setClient(new Client("Sone", SonePlugin.VERSION.toString())); sone.setKnown(true); - loadSone(sone); - sone.setStatus(SoneStatus.idle); - database.storeSone(sone); SoneInserter soneInserter = new SoneInserter(this, eventBus, freenetInterface, ownIdentity.getId()); eventBus.register(soneInserter); synchronized (soneInserters) { soneInserters.put(sone, soneInserter); } + loadSone(sone); + sone.setStatus(SoneStatus.idle); soneInserter.start(); return sone; } @@ -1086,6 +1085,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, for (Album album : topLevelAlbums) { sone.getRootAlbum().addAlbum(album); } + database.storeSone(sone); synchronized (soneInserters) { soneInserters.get(sone).setLastInsertFingerprint(lastInsertFingerprint); }