Guava - problem z Cache

anon10657637 | 2021-02-17 10:26:00 UTC | #1

https://gist.github.com/anonymous/869f3c4a5b85ebf8a676a77021467fbb

Za każdym razem przy użyciu:

Instant instant = this.helpOpCache.getIfPresent(player.getUniqueId());

wykonuje się RemovalListener:

private class HelpopRemovalListener implements RemovalListener<UUID, Instant> {

        @Override
        public void onRemoval(RemovalNotification<UUID, Instant> notification) {
            UUID uuid = notification.getKey();

            Player player = HelpOpModule.this.getTools().getServer().getPlayer(uuid);
            if (player == null) {
                return;
            }

            String message = HelpOpModule.this.getValue("modules.helpop.cooldown.ready");
            player.sendMessage(message);
        }

    }

który nie powinien się wykonywać. Dopiero minutę od ostatniego użycia danego obiektu powinien on się wykonać. Jakieś pomysły? Guava, Apache Commons, Bukkit - wszystko najnowsze.


system | 2021-02-17 10:26:16 UTC | #2

Ten temat został automatycznie zamknięty 32 dni po ostatnim wpisie. Tworzenie nowych odpowiedzi nie jest już możliwe.