From 4d13d704dcd876bc6f4d182bdf3673fe1efd5a47 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sat, 5 Oct 2024 19:48:25 +0200 Subject: Clean up Redis logic Simplify functions and move internal database interfaces into a more appropriate data structure. Configure all database numbers using a redis plugin group, instead of using a custom setting just for the whois database to make the setup more logical. Signed-off-by: Georg Pfuetzenreuter --- config.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'config.py') diff --git a/config.py b/config.py index 14654c5..f58e176 100644 --- a/config.py +++ b/config.py @@ -104,9 +104,21 @@ conf.registerGlobalValue( # REDIS related settings below: ### conf.registerGroup(SnoParser, "redis") +conf.registerGroup(SnoParser.redis, "db") conf.registerGlobalValue( - SnoParser.redis, - "db1", + SnoParser.redis.db, + "ips", + registry.Integer( + 2, + """ + Redis: Database number for counting of IP ADDRESSES. + """, + private=True, + ), +) +conf.registerGlobalValue( + SnoParser.redis.db, + "nicks", registry.Integer( 1, """ @@ -116,21 +128,21 @@ conf.registerGlobalValue( ), ) conf.registerGlobalValue( - SnoParser.redis, - "db2", + SnoParser.redis.db, + "whois", registry.Integer( - 2, + 0, """ - Redis: Database number for counting of IP ADDRESSES. + Redis: Database number for WHOIS query caching. """, - private=True, ), ) + conf.registerGlobalValue( SnoParser.redis, "host", registry.String( - "127.0.0.1", + "localhost", """ Redis: IP address or hostname. """, @@ -218,16 +230,5 @@ conf.registerGlobalValue( private=True, ), ) -conf.registerGroup(SnoParser.whois, "redis") -conf.registerGlobalValue( - SnoParser.whois.redis, - "db", - registry.Integer( - 0, - """ - Redis: Database number for WHOIS query caching. - """, - ), -) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: -- cgit v1.2.3