Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because there is no point in letting the table fill up with records that are excluded from the ip ban queries.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -589,3 +589,12 @@
'sbl-xbl.spamhaus.org'
)));
}
+
+/**
+ * Implementation of hook_cron
+ */
+function troll_cron() {
+
+ // Clean up expired IP addresses from IP ban table
+ db_query('DELETE FROM {troll_ip_ban} WHERE expires > 1000000000 AND expires < %d', time());
+}
Comments
Comment #1
bibo CreditAttribution: bibo commentedI wonder if this should also work with D7?
Comment #2
mgiffordWould be a useful thing to evaluate. I don't see why it wouldn't.
Comment #3
mgifford