]> jfr.im git - irc/rizon/acid.git/commitdiff
Cut down expiry time to 30 minutes.
authorDwarf <redacted>
Sun, 4 Sep 2016 17:41:55 +0000 (19:41 +0200)
committerDwarf <redacted>
Sat, 22 Oct 2016 13:26:50 +0000 (15:26 +0200)
trapbot/src/main/java/net/rizon/acid/plugins/trapbot/ExpireTimer.java
trapbot/src/main/java/net/rizon/acid/plugins/trapbot/trapbot.java
trapbot/trapbot.example.yml

index 14399b8345186cbba1cee0f42d0a9ee62f226c2a..58981e8d7f212be74f9c3670c665739b0c0554d3 100644 (file)
@@ -16,10 +16,10 @@ class ExpireTimer implements Runnable
                        Map.Entry<String, TrappedUser> e = it.next();
                        TrappedUser t = e.getValue();
 
-                       /* how many days have passed */
-                       int days = (int)((now.getTime() - t.lastTrap.getTime()) / (1000 * 60 * 60 * 24));
+                       /* how many minutes have passed */
+                       int minutes = (int)((now.getTime() - t.lastTrap.getTime()) / (1000 * 60));
 
-                       if (days >= trapbot.conf.expire)
+                       if (minutes >= trapbot.conf.expire)
                                it.remove();
                }
        }
index e59fb995c5684ff1c69da61dae52d567388a0f82..6308377ddabb38b15799c678243c9129ae5afe2a 100644 (file)
@@ -82,7 +82,7 @@ public class trapbot extends Plugin
 
                reload();
 
-               expireTimer = Acidictive.scheduleWithFixedDelay(new ExpireTimer(), 1, TimeUnit.DAYS);
+               expireTimer = Acidictive.scheduleWithFixedDelay(new ExpireTimer(), 10, TimeUnit.MINUTES);
 
                // magic!
                releaseTimer = Acidictive.schedule(new ReleaseTimer(), new Random().nextInt(2700) + 2700, TimeUnit.SECONDS);
index 7ef0a84a0632d085ca941db1eccf0cbf68d98cd7..2406f29b4254c67a4f9a21481119e365771ff8a3 100644 (file)
@@ -21,5 +21,5 @@ clients:
 trapbot: TrapBot
 # Our name for the channel that is the trap channel
 trapchan: trapchan
-# Number of days before IPs added to the trap list are forgotten
-expire: 2
+# Number of minutes before IPs added to the trap list are forgotten
+expire: 30