From 0bc863b289d89e726474baf8b8d35fc4f78a6d62 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 9 Jan 2015 15:47:04 +0100 Subject: [PATCH] Async f list pager creation. The sorting of factions is slow as well. --- .../com/massivecraft/factions/cmd/CmdFactionsList.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java index df984f81..f9ae5e78 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -46,10 +46,6 @@ public class CmdFactionsList extends FactionsCommand final Integer pageHumanBased = this.arg(0, ARInteger.get(), 1); if (pageHumanBased == null) return; - // Create Pager - final List timings = FactionColl.get().getAll(null, FactionListComparator.get()); - final PagerSimple pager = new PagerSimple(timings, sender); - // NOTE: The faction list is quite slow and mostly thread safe. // We run it asynchronously to spare the primary server thread. final CommandSender sender = this.sender; @@ -58,6 +54,10 @@ public class CmdFactionsList extends FactionsCommand @Override public void run() { + // Create Pager + final List factions = FactionColl.get().getAll(null, FactionListComparator.get()); + final PagerSimple pager = new PagerSimple(factions, sender); + // Use Pager List messages = pager.getPageTxt(pageHumanBased, "Faction List", new Stringifier() { @Override