From b81a7e65d2787ce800c47bd5c2f53ecd76ef61ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 15 Jan 2023 03:34:34 +0100 Subject: [PATCH] Disable random seed update because SecureRandom is self-seeding with a better algorithm --- src/main/java/wtf/beatrice/hidekobot/HidekoBot.java | 3 --- .../beatrice/hidekobot/runnables/RandomSeedTask.java | 12 ------------ 2 files changed, 15 deletions(-) delete mode 100644 src/main/java/wtf/beatrice/hidekobot/runnables/RandomSeedTask.java diff --git a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java index 7b9983f..8f5233a 100644 --- a/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java +++ b/src/main/java/wtf/beatrice/hidekobot/HidekoBot.java @@ -16,7 +16,6 @@ import wtf.beatrice.hidekobot.datasources.PropertiesSource; import wtf.beatrice.hidekobot.listeners.*; import wtf.beatrice.hidekobot.runnables.ExpiredMessageTask; import wtf.beatrice.hidekobot.runnables.HeartBeatTask; -import wtf.beatrice.hidekobot.runnables.RandomSeedTask; import wtf.beatrice.hidekobot.runnables.StatusUpdateTask; import wtf.beatrice.hidekobot.util.CommandUtil; import wtf.beatrice.hidekobot.util.FormatUtil; @@ -199,8 +198,6 @@ public class HidekoBot scheduler.scheduleAtFixedRate(heartBeatTask, 10L, 30L, TimeUnit.SECONDS); //every 30 seconds StatusUpdateTask statusUpdateTask = new StatusUpdateTask(); scheduler.scheduleAtFixedRate(statusUpdateTask, 0L, 60L * 5L, TimeUnit.SECONDS); // every 5 minutes - RandomSeedTask randomSeedTask = new RandomSeedTask(); - scheduler.scheduleAtFixedRate(randomSeedTask, 0L, 60L, TimeUnit.SECONDS); // every minute // register shutdown interrupt signal listener for proper shutdown. Signal.handle(new Signal("INT"), signal -> shutdown()); diff --git a/src/main/java/wtf/beatrice/hidekobot/runnables/RandomSeedTask.java b/src/main/java/wtf/beatrice/hidekobot/runnables/RandomSeedTask.java deleted file mode 100644 index f4623a0..0000000 --- a/src/main/java/wtf/beatrice/hidekobot/runnables/RandomSeedTask.java +++ /dev/null @@ -1,12 +0,0 @@ -package wtf.beatrice.hidekobot.runnables; - -import wtf.beatrice.hidekobot.Cache; - -public class RandomSeedTask implements Runnable -{ - - @Override - public void run() { - Cache.setRandomSeed(System.currentTimeMillis()); - } -}